def main(argv=None):
    '\n    Handles command line arguments and gets things started.\n\n    :param argv: List of arguments, as if specified on the command-line.\n                 If None, ``sys.argv[1:]`` is used instead.\n    :type argv: list of str\n    '
    parser = argparse.ArgumentParser(description='Takes one or more file paths and reports their detected                      encodings')
    parser.add_argument('input', help='File whose encoding we would like to determine.                               (default: stdin)', type=argparse.FileType('rb'), nargs='*', default=[(sys.stdin if PY2 else sys.stdin.buffer)])
    parser.add_argument('--version', action='version', version='%(prog)s {0}'.format(__version__))
    args = parser.parse_args(argv)
    for f in args.input:
        if f.isatty():
            print(((('You are running chardetect interactively. Press ' + 'CTRL-D twice at the start of a blank line to signal the ') + 'end of your input. If you want help, run chardetect ') + '--help\n'), file=sys.stderr)
        print(description_of(f, f.name))
Handles command line arguments and gets things started.

:param argv: List of arguments, as if specified on the command-line.
             If None, ``sys.argv[1:]`` is used instead.
:type argv: list of str
def main(argv=None):
    '\n    Handles command line arguments and gets things started.\n\n    :param argv: List of arguments, as if specified on the command-line.\n                 If None, ``sys.argv[1:]`` is used instead.\n    :type argv: list of str\n    '
    parser = argparse.ArgumentParser(description='Takes one or more file paths and reports their detected                      encodings')
    parser.add_argument('input', help='File whose encoding we would like to determine.                               (default: stdin)', type=argparse.FileType('rb'), nargs='*', default=[(sys.stdin if PY2 else sys.stdin.buffer)])
    parser.add_argument('--version', action='version', version='%(prog)s {0}'.format(__version__))
    args = parser.parse_args(argv)
    for f in args.input:
        if f.isatty():
            print(((('You are running chardetect interactively. Press ' + 'CTRL-D twice at the start of a blank line to signal the ') + 'end of your input. If you want help, run chardetect ') + '--help\n'), file=sys.stderr)
        print(description_of(f, f.name))