#!/usr/bin/python3 import argparse def main(): parser = argparse.ArgumentParser(allow_abbrev=False) parser_process_pathnames = argparse.ArgumentParser(allow_abbrev=False, add_help=False) parser_process_pathnames_input = parser_process_pathnames.add_argument_group(title="INPUT", description="bla") parser_process_pathnames_input.add_argument("pathnames", nargs="*", type=str, help="pathnames of files to be processed", metavar="PATHNAME") parser_process_pathnames_input_mut_excl = parser_process_pathnames_input.add_mutually_exclusive_group() parser_process_pathnames_input_mut_excl.add_argument("--from-args", action="store_true", help="") parser_process_pathnames_input_mut_excl.add_argument("--from-files", action="store_true", help="") parser_process_pathnames_input_mut_excl.add_argument("--from-stdin", action="store_true", help="") parser_process_pathnames_input.add_argument("--input-pathname-separator", default="XXXXXXX", help="") subparsers = parser.add_subparsers(required=True, dest="subcommand_name", description="Determine the program’s main action.", help="Name of the subcommand to be executed. One of:", metavar="SUBCOMMAND") subparser_set = subparsers.add_parser("set", help="", parents=[parser_process_pathnames], allow_abbrev=False) subparser_verify = subparsers.add_parser("verify", aliases=["check"], help="", parents=[parser_process_pathnames], allow_abbrev=False) args = parser.parse_args() if __name__ == "__main__": main()