def parse_args(args):
parser = argparse.ArgumentParser()
group = parser.add_mutually_exclusive_group()
group.add_argument('-v', '--verbose', help='Verbose (debug) logging',
action='store_const', const=logging.DEBUG,
dest='loglevel')
group.add_argument('-q', '--quiet', help='Silent mode, only log warnings',
action='store_const', const=logging.WARN,
dest='loglevel')
parser.add_argument("-s", '--skip', action='store_true',
dest='skip_errors',
help="Do not stop if one steps is failed")
parser.add_argument("-e", '--callback',
help='Callback for backup file (backup path '
'passed as a 1st arg)')
parser.add_argument(
'backup_dir', help="Destination for all created files")
parser.set_defaults(func=do_node_backup)
return parser.parse_args(args)
评论列表
文章目录