def parse_args():
    """
    parse main() args
    """
    description = (
        "Get Wikipedia article info and Wikidata via MediaWiki APIs.\n\n"
        "Gets a random English Wikipedia article by default, or in the\n"
        "language -lang, or from the wikisite -wiki, or by specific\n"
        "title -title. The output is a plain text extract unless -HTML.")
    epilog = ("Powered by https://github.com/siznax/wptools/ %s"
              % wptools.__version__)
    argp = argparse.ArgumentParser(
        description=description,
        formatter_class=argparse.RawDescriptionHelpFormatter,
        epilog=epilog)
    argp.add_argument("-H", "-HTML", action='store_true',
                      help="output HTML extract")
    argp.add_argument("-l", "-lang", default='en',
                      help="language code")
    argp.add_argument("-n", "-nowrap", action='store_true',
                      help="do not wrap text")
    argp.add_argument("-q", "-query", action='store_true',
                      help="show query and exit")
    argp.add_argument("-s", "-silent", action='store_true',
                      help="quiet output to stderr")
    argp.add_argument("-t", "-title", help="get a specific title")
    argp.add_argument("-v", "-verbose", action='store_true',
                      help="HTTP status to stderr")
    argp.add_argument("-w", "-wiki",
                      help="use alternative wikisite")
    return argp.parse_args()
def parse_args ( ) : description = ( "Get Wikipedia article info and Wikidata via MediaWiki APIs.\n\n" "Gets a random English Wikipedia article by default, or in the\n" "language -lang, or from the wikisite -wiki, or by specific\n" "title -title. The output is a plain text extract unless -HTML." ) epilog = ( "Powered by https://github.com/siznax/wptools/ %s" % wptools . __version__ ) argp = argparse . ArgumentParser ( description = description , formatter_class = argparse . RawDescriptionHelpFormatter , epilog = epilog ) argp . add_argument ( "-H" , "-HTML" , action = 'store_true' , help = "output HTML extract" ) argp . add_argument ( "-l" , "-lang" , default = 'en' , help = "language code" ) argp . add_argument ( "-n" , "-nowrap" , action = 'store_true' , help = "do not wrap text" ) argp . add_argument ( "-q" , "-query" , action = 'store_true' , help = "show query and exit" ) argp . add_argument ( "-s" , "-silent" , action = 'store_true' , help = "quiet output to stderr" ) argp . add_argument ( "-t" , "-title" , help = "get a specific title" ) argp . add_argument ( "-v" , "-verbose" , action = 'store_true' , help = "HTTP status to stderr" ) argp . add_argument ( "-w" , "-wiki" , help = "use alternative wikisite" ) return argp . parse_args ( )
parse main() args