Code Duplication    Length = 43-49 lines in 2 locations

tools/xml2file/xml2file.py 1 location

@@ 22-70 (lines=49) @@
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
        type=int,
44
        default=0,
45
        metavar='LEVEL',
46
        help='log verbose'
47
    )
48
    parser.add_argument(
49
        '--encoding',
50
        default='utf-8',
51
        help='output file encoding.'
52
    )
53
    parser.add_argument(
54
        '--clean',
55
        action='store_true',
56
        help='clean output directory (before)'
57
    )
58
    parser.add_argument(
59
        '--debug',
60
        action='store_true',
61
        help='log debug'
62
    )
63
    parser.add_argument(
64
        'file',
65
        metavar='FILE',
66
        nargs='+',
67
        help='test result xml files'
68
    )
69
    options = parser.parse_args()
70
    return options
71
72
cmdline_options = None
73

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