def cli():
parser = argparse.ArgumentParser()<EOL>parser.add_argument('<STR_LIT>', help="""<STR_LIT>""")<EOL>parser.add_argument('<STR_LIT:url>', help="""<STR_LIT>""")<EOL>parser.add_argument('<STR_LIT>', help="""<STR_LIT>""")<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>', help="""<STR_LIT>""", action='<STR_LIT:store_true>')<EOL>parser.add_argument('<STR_LIT>', '<STR_LIT>', help="""<STR_LIT>""")<EOL>fields = text = html = None<EOL>_args = parser.parse_args()<EOL>if _args.all:<EOL><INDENT>fields = '<STR_LIT:*>'<EOL><DEDENT>if _args.file == '<STR_LIT:->':<EOL><INDENT>text = sys.stdin.read()<EOL><DEDENT>elif _args.file:<EOL><INDENT>with open(_args.file, '<STR_LIT:rb>') as src:<EOL><INDENT>if os.path.splitext(_args.file)[<NUM_LIT:1>] in ('<STR_LIT>', '<STR_LIT>'):<EOL><INDENT>html = src.read().decode(ENCODING)<EOL><DEDENT>else:<EOL><INDENT>text = src.read().decode(ENCODING)<EOL><DEDENT><DEDENT><DEDENT>print(json.dumps((api(_args.api, _args.url, _args.token,<EOL>html=html or None,<EOL>text=text or None,<EOL>fields=fields)),<EOL>sort_keys=True,<EOL>indent=<NUM_LIT:2>))<EOL>
Command line tool.