Construct a Parser

Construct a parser

def create_parser():
    parser = argparse.ArgumentParser(description = 'messenger')
    parser.add_argument('--private-key-file', type = str, dest = 'private_key_file', required = False, help = 'Path to the private key file.')
    parser.add_argument('--send-msg-id', type = str, dest = 'send_msg_id', required = False, help = 'Send a message, msg_id')
    parser.add_argument('--send-msg-from', type = str, dest = 'send_msg_from', required = False, help = 'Send a message, from which EOS account')
    parser.add_argument('--send-msg-to', type = str, dest = 'send_msg_to', required = False, help = 'Send a message, to which EOS account')
    parser.add_argument('--send-msg', type = str, dest = 'send_msg', required = False, help = 'Message to be sent')
    parser.add_argument('--read-msg-to', type = str, dest = 'read_msg_to', required = False, help = 'Read a message, to which EOS account')
    return parser

parser = create_parser()
args = parser.parse_args(argv)
Close Menu
×

Cart