-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathparser_args.py
67 lines (54 loc) · 1.75 KB
/
parser_args.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
from argparse import ArgumentParser
def parse_args():
parser = ArgumentParser(
description='Clone repository and check naming convention '
'for multiple-word identifiers.'
)
subparsers = parser.add_subparsers(help='sub-command help')
parser_freq = subparsers.add_parser(
'freq',
help='Find frequency for part of speech'
)
parser_freq.add_argument(
'-p', '--pos', choices=['verbs', 'nouns'], default='verbs',
help='Select part of speech to analyze'
)
parser_freq.add_argument(
'-n', '--node', choices=['func', 'var'], default='func',
help='Select node to search names - functions of local variables'
)
parser.add_argument(
'-o', '--format', choices=['txt', 'json', 'csv'], default='txt',
help='Select format to output results'
)
parser.add_argument(
'-f', '--file', default='stdout',
help='Select file to output results'
)
parser.add_argument(
'-r', '--repo',
default='https://github.com/PyExplorer/check_naming_convention.git',
help='Select repo to clone'
)
parser.add_argument(
'-d', '--dir',
help='local directory for storing repo',
default='repos',
)
parser.add_argument(
'--plang', choices=['python'],
default='python',
help='programming language to parse'
)
parser.add_argument(
'--noclone',
help='no clone from repo - take only from dir (-d)',
action='store_true'
)
parser.add_argument(
'--clear',
help='clear repo after script finished',
action='store_true'
)
parser.add_argument('-l', '--log', type=str, dest='log', default='')
return parser.parse_args()