Ejemplo n.º 1
0
profile = False
profsort = 4

if __name__ == '__main__':
    import getopt
    opts, args = getopt.getopt(sys.argv[1:], 'n:l:aepO:s:h')
    for opt, val in opts:
        if opt == '-n':
            num = int(val)
        elif opt == '-a':
            showall = True
        elif opt == '-e':
            ignerror = True
        elif opt == '-l':
            lexer = val
        elif opt == '-p':
            profile = True
        elif opt == '-s':
            profsort = int(val)
        elif opt == '-O':
            options = _parse_options([val])
        elif opt == '-h':
            print_help()
            sys.exit(0)
    ret = 0
    if not args:
        print_help()
    for f in args:
        ret += main(f, lexer, options)
    sys.exit(bool(ret))
Ejemplo n.º 2
0
profile = False
profsort = 4

if __name__ == '__main__':
    import getopt
    opts, args = getopt.getopt(sys.argv[1:], 'n:l:aepO:s:h')
    for opt, val in opts:
        if opt == '-n':
            num = int(val)
        elif opt == '-a':
            showall = True
        elif opt == '-e':
            ignerror = True
        elif opt == '-l':
            lexer = val
        elif opt == '-p':
            profile = True
        elif opt == '-s':
            profsort = int(val)
        elif opt == '-O':
            options = _parse_options([val])
        elif opt == '-h':
            print_help()
            sys.exit(0)
    ret = 0
    if not args:
        print_help()
    for f in args:
        ret += main(f, lexer, options)
    sys.exit(bool(ret))
Ejemplo n.º 3
0
def test_parse_opts():
    assert cmdline._parse_options(['  ', 'keyonly,key = value ']) == \
        {'keyonly': True, 'key': 'value'}
Ejemplo n.º 4
0
 def test_parse_opts(self):
     self.assertEqual(
         cmdline._parse_options(['  ', 'keyonly,key = value ']), {
             'keyonly': True,
             'key': 'value'
         })
Ejemplo n.º 5
0
 def test_parse_opts(self):
     self.assertEqual(cmdline._parse_options(['  ', 'keyonly,key = value ']),
                      {'keyonly': True, 'key': 'value'})