@@ 24-66 (lines=43) @@ | ||
21 | ||
22 | ||
23 | # command line option |
|
24 | def parse_command_line(): |
|
25 | parser = ArgumentParser() |
|
26 | parser.add_argument( |
|
27 | '-v', |
|
28 | '--version', |
|
29 | action='version', |
|
30 | version=u'%(prog)s version 0.2' |
|
31 | ) |
|
32 | parser.add_argument( |
|
33 | '-r', |
|
34 | '--repeat', |
|
35 | action=EvalIntAction, |
|
36 | nargs=1, |
|
37 | default=1, |
|
38 | help='Set eval repeat count.' |
|
39 | ) |
|
40 | parser.add_argument( |
|
41 | '-s', |
|
42 | '--start', |
|
43 | action=EvalIntAction, |
|
44 | nargs=1, |
|
45 | default=0, |
|
46 | help='Set eval repeat start no.' |
|
47 | ) |
|
48 | parser.add_argument( |
|
49 | '-o', |
|
50 | '--output', |
|
51 | default=None, |
|
52 | help='output file path.' |
|
53 | ) |
|
54 | parser.add_argument( |
|
55 | '--encoding', |
|
56 | default=None, |
|
57 | help='output file encoding.' |
|
58 | ) |
|
59 | parser.add_argument( |
|
60 | 'expression', |
|
61 | metavar='EXP', |
|
62 | nargs='+', |
|
63 | help='eval expressions' |
|
64 | ) |
|
65 | options = parser.parse_args() |
|
66 | return options |
|
67 | ||
68 | ||
69 | def eval_line(r, define, line): |
@@ 20-61 (lines=42) @@ | ||
17 | from argparse import ArgumentParser |
|
18 | ||
19 | # command line option |
|
20 | def parse_command_line(): |
|
21 | parser = ArgumentParser() |
|
22 | parser.add_argument( |
|
23 | '-v', |
|
24 | '--version', |
|
25 | action='version', |
|
26 | version=u'%(prog)s version 0.1' |
|
27 | ) |
|
28 | parser.add_argument( |
|
29 | '-o', |
|
30 | '--output', |
|
31 | default=None, |
|
32 | help='output file path.' |
|
33 | ) |
|
34 | parser.add_argument( |
|
35 | '--no-time', |
|
36 | action='store_true', |
|
37 | help='no output time attribute' |
|
38 | ) |
|
39 | parser.add_argument( |
|
40 | '--verbose', |
|
41 | action='store_true', |
|
42 | help='log verbose' |
|
43 | ) |
|
44 | parser.add_argument( |
|
45 | '--encoding', |
|
46 | default=None, |
|
47 | help='output file encoding.' |
|
48 | ) |
|
49 | parser.add_argument( |
|
50 | '--debug', |
|
51 | action='store_true', |
|
52 | help='log debug' |
|
53 | ) |
|
54 | parser.add_argument( |
|
55 | 'file', |
|
56 | metavar='FILE', |
|
57 | nargs='+', |
|
58 | help='test result xml files' |
|
59 | ) |
|
60 | options = parser.parse_args() |
|
61 | return options |
|
62 | ||
63 | cmdline_options = None |
|
64 |