INNER CODE UNIT · Python

cmd_line

labgem/PPanGGOLiN · ppanggolin/main.py:135

def cmd_line() -> argparse.Namespace:
    """Manage the command line argument given by user

    :return: arguments given and readable by PPanGGOLiN
    """
    parser = build_parser()

    # print help if no subcommand is specified
    if len(sys.argv) == 1:
        parser.print_help()
        sys.exit(0)

    # print help if only the command is given
    subcommands = parser._subparsers._group_actions[0].choices
    for sub_name, sub in subcommands.items():
        if len(sys.argv) == 2 and sub_name == sys.argv[1]:
            sub.print_help()
            exit(0)

View source record →

📰 Research Paper
Loading…
⏳ Fetching content…