def process_arguments()

in shelldocs/src/main/python/shelldocs.py [0:0]


def process_arguments():
    ''' deal with parameters '''
    parser = ArgumentParser(
        prog='shelldocs',
        epilog="You can mark a file to be ignored by shelldocs by adding"
        " 'SHELLDOC-IGNORE' as comment in its own line. " +
        "--input may be given multiple times.")
    parser.add_argument("-o",
                        "--output",
                        dest="outfile",
                        action="store",
                        type=str,
                        help="file to create",
                        metavar="OUTFILE")
    parser.add_argument("-i",
                        "--input",
                        dest="infile",
                        action="append",
                        type=str,
                        help="file to read",
                        metavar="INFILE")
    parser.add_argument("--skipprnorep",
                        dest="skipprnorep",
                        action="store_true",
                        help="Skip Private & Not Replaceable")
    parser.add_argument("--lint",
                        dest="lint",
                        action="store_true",
                        help="Enable lint mode")
    parser.add_argument(
        "-V",
        "--version",
        dest="release_version",
        action="store_true",
        default=False,
        help="display version information for shelldocs and exit.")

    options = parser.parse_args()

    if options.release_version:
        print(getversion())
        sys.exit(0)

    if options.infile is None:
        parser.error("At least one input file needs to be supplied")
    elif options.outfile is None and options.lint is None:
        parser.error(
            "At least one of output file and lint mode needs to be specified")

    return options