Code Duplication    Length = 43-47 lines in 2 locations

tools/xml2file/xml2file.py 1 location

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

tools/python/eval_line.py 1 location

@@ 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):