def load_file_data():
pass
def dump_redis_data():
pass
def get_parser():
"""
Creates a new argument parser.
"""
parser = argparse.ArgumentParser('RedisData')
group = parser.add_mutually_exclusive_group() #互斥
group.add_argument('--load', '-l', type=load_file_data,
help='Load a File to Redis Data: -l xxx.log', )
group.add_argument('--dump', '-d', nargs='?', const='', type=dump_redis_data,
help='Dump Redis Data to File: -d or -d /home/filepath/data/data/wa_data/xxx.log', )
return parser
def main(args=None):
parser = get_parser()
args = parser.parse_args(args)
if __name__ == '__main__':
main()
网友评论