def get_parsed_args():
    'Create argument parser and parse arguments'
    parser = argparse.ArgumentParser(description='Build the ATT&CK website.\nAll flags are optional. If you run the build without flags, the modules that pertain to the ATT&CK dataset will be ran. If you would like to run extra modules, opt-in these modules with the--extras flag.')
    parser.add_argument('--refresh', '-r', action='store_true', help='Pull down the current STIX data from the MITRE/CTI GitHub respository')
    parser.add_argument('--no-stix-link-replacement', action='store_true', help='If this flag is absent, links to attack.mitre.org/[page] in the STIX data will be replaced with /[page]. Add this flag to preserve links to attack.mitre.org.')
    parser.add_argument('--modules', '-m', nargs='+', type=str, choices=module_choices, help="Run specific modules by selecting from the list and leaving one space in between them. For example: '-m clean techniques tactics'.Will run all the modules if flag is not called, or selected without arguments.")
    parser.add_argument('--extras', '-e', nargs='*', type=str, choices=extras, help="Run extra modules that do not pertain to the ATT&CK dataset. Select from the list and leaving one space in between them. For example: '-m resources blog'.\nThese modules will only run if the user adds this flag. Calling this flag without arguments will select all the extra modules.")
    parser.add_argument('--test', '-t', nargs='+', choices=test_choices, dest='tests', help="Run specific tests by selecting from the list and leaving one space in between them. For example: '-t output links'. Tests: size (size of output directory against github pages limit); links (dead internal hyperlinks and relative hyperlinks); external_links (dead external hyperlinks); citations (unparsed citation text).")
    parser.add_argument('--attack-brand', action='store_true', help='Applies ATT&CK brand colors. See also the --extras flag.')
    parser.add_argument('--proxy', help='set proxy')
    parser.add_argument('--subdirectory', help='If you intend to host the site from a sub-directory, specify the directory using this flag.', type=validate_subdirectory_string)
    parser.add_argument('--print-tests', dest='print_tests', action='store_true', help='Force test output to print to stdout even if the results are very long.')
    parser.add_argument('--no-test-exitstatus', dest='override_exit_status', action='store_true', help='Forces application to exit with success status codes even if tests fail.')
    args = parser.parse_args()
    if (not args.modules):
        args.modules = module_choices
    if ((not args.extras) and isinstance(args.extras, list)):
        args.extras = extras
    site_config.args = args
    return args
Create argument parser and parse arguments
def get_parsed_args():
    
    parser = argparse.ArgumentParser(description='Build the ATT&CK website.\nAll flags are optional. If you run the build without flags, the modules that pertain to the ATT&CK dataset will be ran. If you would like to run extra modules, opt-in these modules with the--extras flag.')
    parser.add_argument('--refresh', '-r', action='store_true', help='Pull down the current STIX data from the MITRE/CTI GitHub respository')
    parser.add_argument('--no-stix-link-replacement', action='store_true', help='If this flag is absent, links to attack.mitre.org/[page] in the STIX data will be replaced with /[page]. Add this flag to preserve links to attack.mitre.org.')
    parser.add_argument('--modules', '-m', nargs='+', type=str, choices=module_choices, help="Run specific modules by selecting from the list and leaving one space in between them. For example: '-m clean techniques tactics'.Will run all the modules if flag is not called, or selected without arguments.")
    parser.add_argument('--extras', '-e', nargs='*', type=str, choices=extras, help="Run extra modules that do not pertain to the ATT&CK dataset. Select from the list and leaving one space in between them. For example: '-m resources blog'.\nThese modules will only run if the user adds this flag. Calling this flag without arguments will select all the extra modules.")
    parser.add_argument('--test', '-t', nargs='+', choices=test_choices, dest='tests', help="Run specific tests by selecting from the list and leaving one space in between them. For example: '-t output links'. Tests: size (size of output directory against github pages limit); links (dead internal hyperlinks and relative hyperlinks); external_links (dead external hyperlinks); citations (unparsed citation text).")
    parser.add_argument('--attack-brand', action='store_true', help='Applies ATT&CK brand colors. See also the --extras flag.')
    parser.add_argument('--proxy', help='set proxy')
    parser.add_argument('--subdirectory', help='If you intend to host the site from a sub-directory, specify the directory using this flag.', type=validate_subdirectory_string)
    parser.add_argument('--print-tests', dest='print_tests', action='store_true', help='Force test output to print to stdout even if the results are very long.')
    parser.add_argument('--no-test-exitstatus', dest='override_exit_status', action='store_true', help='Forces application to exit with success status codes even if tests fail.')
    args = parser.parse_args()
    if (not args.modules):
        args.modules = module_choices
    if ((not args.extras) and isinstance(args.extras, list)):
        args.extras = extras
    site_config.args = args
    return args