示例#1
0
def create_command_line_argument_parser():
    parser = argparse.ArgumentParser(description='A RESTful microservice for blocking IP addresses.')
    utilities.add_config_option(parser, 'blockip')
    parser.add_argument('--debug', action='store_true', help='If given, Flask is started in debug mode.')
    parser.add_argument('--no-permission-checks', action='store_true', help='If given, permissions aren\'t checked.')
    utilities.add_log_level_options(parser)
    return parser
示例#2
0
def create_command_line_argument_parser():
    parser = argparse.ArgumentParser(description="Creates the database used by blockip.")
    utilities.add_config_option(parser, "blockip")
    parser.add_argument("-D", "--drop-schema", action="store_true")
    parser.add_argument(
        "--drop-schema-even-if-the-database-is-not-local-yes-i-am-absolutely-sure-i-want-to-do-that",
        action="store_true",
        help=argparse.SUPPRESS,
    )
    parser.add_argument("--dry-run", action="store_true")
    utilities.add_log_level_options(parser)
    return parser