<commit_before>#
#   Pyrex - Command Line Parsing
#

import sys

usage = """\
Usage: pyrexc [options] sourcefile...
Options:
  -v, --version                  Display version number of pyrex compiler
  -l, --create-listing           Write error messages to a listing file
  -I, --include-dir <directory>  Search for include files in named directory
  -o, --output-file <filename>   Specify name of generated C file
The following experimental options are supported only on MacOSX:
  -C, --compile    Compile generated .c file to .o file
  -X, --link       Link .o file to produce extension module (implies -C)
  -+, --cplus      Use C++ compiler for compiling and linking
  Additional .o files to link may be supplied when using -X."""

def bad_usage():
    print >>sys.stderr, usage
    sys.exit(1)

def parse_command_line(args):
    from Pyrex.Compiler.Main import \
        CompilationOptions, default_options

    def pop_arg():
        if args:
            return args.pop(0)
        else:
            bad_usage()
    
    def get_param(option):
        tail = option[2:]
        if tail:
            return tail
        else:
            return pop_arg()

    options = CompilationOptions(default_options)<commit_msg>Add to help that multiple include directories are allowed.<commit_after>#
#   Pyrex - Command Line Parsing
#

import sys

usage = """\
Usage: pyrexc [options] sourcefile...
Options:
  -v, --version                  Display version number of pyrex compiler
  -l, --create-listing           Write error messages to a listing file
  -I, --include-dir <directory>  Search for include files in named directory
                                 (multiply include directories are allowed).
  -o, --output-file <filename>   Specify name of generated C file
The following experimental options are supported only on MacOSX:
  -C, --compile    Compile generated .c file to .o file
  -X, --link       Link .o file to produce extension module (implies -C)
  -+, --cplus      Use C++ compiler for compiling and linking
  Additional .o files to link may be supplied when using -X."""

def bad_usage():
    print >>sys.stderr, usage
    sys.exit(1)

def parse_command_line(args):
    from Pyrex.Compiler.Main import \
        CompilationOptions, default_options

    def pop_arg():
        if args:
            return args.pop(0)
        else:
            bad_usage()
    
    def get_param(option):
        tail = option[2:]
        if tail:
            return tail
        else:
            return pop_arg()

    options = CompilationOptions(default_options)
{'fraction_non_alphanumeric': 0.08814352574102964, 'fraction_numerical': 0.00234009360374415, 'mean_word_length': 2.21831869510665, 'pattern_counts': {'":': 0, '<': 7, '<?xml version=': 0, '>': 11, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 1, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '632466', 'n_tokens_mistral': 724, 'n_tokens_neox': 696, 'n_words': 274}