Skip to content

Commit 2cfb8c6

Browse files
authored
chore: update the order of CLI args and documentation (#53)
Signed-off-by: Andrew Brandt <andrew.brandt@hashgraph.com>
1 parent eed96a0 commit 2cfb8c6

2 files changed

Lines changed: 80 additions & 53 deletions

File tree

current-implemented-CLI.md

Lines changed: 18 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -2,18 +2,25 @@
22

33
## Currently Implemented
44

5-
- `include-team` - Include a team to the query
65
- `output-file` - Define the filename and location of the output file
6+
- `temp-dir` - The temporary directory to write JSON response files
7+
8+
- `include-team` - Include a team to the query
9+
710

811
## To Be Implemented
912

10-
- `include_user` - Include a specific user to the query
11-
- `include_repository` - Include specific repo(s) to the query
12-
- `include_organization_repository` - Include specific org(s) repo(s) to the query
13-
- `include_label` - Include a specific label to the query
14-
- `exclude_organization` - Exclude specific org(s) from the output
15-
- `exclude_repository` - Exclude specific repo(s) from the output
16-
- `exclude_organization_repository` - Exclude specific org(s) repo(s) from the output
17-
- `exclude_user` - Exclude specific user from the output
18-
- `exclude_label` - Exclude issues with specific label from the output
19-
- `publish_board` - Copy output of script to a common board in GitHub by using the GH API
13+
- `include-user` - Include a specific user to the query
14+
- `include-repository` - Include specific repo to the query
15+
- `include-organization` - Include specific org to a query
16+
- `include-organization-repository` - Include specific org/repo to the query
17+
- `include-label` - Include a specific label to the query
18+
19+
- `exclude-team` - Exclude specific team from the output
20+
- `exclude-user` - Exclude specific user from the output
21+
- `exclude-repository` - Exclude specific repo from the output
22+
- `exclude-organization` - Exclude specific org from the output
23+
- `exclude-organization-repository` - Exclude specific org/repo from the output
24+
- `exclude-label` - Exclude issues with specific label from the output
25+
26+
- `publish-board` - Copy output of script to a common board in GitHub by using the GH API

src/version2config.py

Lines changed: 62 additions & 42 deletions
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,15 @@ def init_parser(self):
3434
action="store",
3535
type=str,
3636
default="tmp.dir",
37-
help="The temporary directory to store the json data files",
37+
help="The temporary directory to store the json data files"
38+
)
39+
40+
parser.add_argument(
41+
"--include-team",
42+
dest="include_team",
43+
action="append",
44+
type=str,
45+
help="Include provided teams in the output"
3846
)
3947

4048
parser.add_argument(
@@ -43,103 +51,114 @@ def init_parser(self):
4351
action="append",
4452
type=str,
4553
nargs="+",
46-
help="Include all issues and PRs for the provided user [Required Parameter]",)
47-
48-
parser.add_argument(
49-
"--include-team",
50-
dest="include_team",
51-
action="append",
52-
type=str,
53-
help="Include provided teams in the output"
54+
help="Include all issues and PRs for the provided user [Required Parameter]"
5455
)
5556

5657
parser.add_argument(
57-
"--exclude-team",
58-
dest="exclude_team",
59-
action="append",
60-
type=str,
61-
help="Exclude provided teams in the output"
58+
"--include-repository",
59+
dest="include_repository",
60+
action="append",
61+
type=str,
62+
help="Include all issues and PRs from the specified repository"
6263
)
6364

6465
parser.add_argument(
65-
"--include-repository",
66-
dest="include_repository",
66+
"--include-organization",
67+
dest="include_organization",
6768
action="append",
6869
type=str,
69-
help="Include all issues and PRs from the specified repository",)
70+
help="Include all issues and PRs from the specified organization"
71+
)
7072

7173
parser.add_argument(
7274
"--include-organization-repository",
7375
dest="include_organization_repository",
7476
action="append",
7577
type=str,
76-
help="Include all issues and PRs from the specified organization/repository",)
78+
help="Include all issues and PRs from the specified organization/repository"
79+
)
7780

7881
parser.add_argument(
7982
"--include-label",
8083
dest="include_label",
8184
action="append",
8285
type=str,
83-
help="Include all issues and PRs with the specified label",)
86+
help="Include all issues and PRs with the specified label"
87+
)
8488

8589
parser.add_argument(
86-
"--exclude-organization",
87-
dest="exclude_organization",
90+
"--exclude-team",
91+
dest="exclude_team",
92+
action="append",
93+
type=str,
94+
help="Exclude provided teams in the output"
95+
)
96+
97+
parser.add_argument(
98+
"--exclude-user",
99+
dest="exclude_user",
88100
action="append",
89101
type=str,
90-
help="Exclude all issues and PRs from the specified organization",)
102+
help="Exclude all issues and PRs for the provided user"
103+
)
91104

92105
parser.add_argument(
93106
"--exclude-repository",
94107
dest="exclude_repository",
95108
action="append",
96109
type=str,
97-
help="Exclude all issues and PRs from the specified repository",)
110+
help="Exclude all issues and PRs from the specified repository"
111+
)
98112

99113
parser.add_argument(
100-
"--exclude-organization-repository",
101-
dest="exclude_organization_repository",
114+
"--exclude-organization",
115+
dest="exclude_organization",
102116
action="append",
103117
type=str,
104-
help="Exclude all issues and PRs from the specified "
105-
"organization/repository",)
118+
help="Exclude all issues and PRs from the specified organization"
119+
)
106120

107121
parser.add_argument(
108-
"--exclude-user",
109-
dest="exclude_user",
122+
"--exclude-organization-repository",
123+
dest="exclude_organization_repository",
110124
action="append",
111125
type=str,
112-
help="Exclude all issues and PRs for the provided user",)
126+
help="Exclude all issues and PRs from the specified "
127+
"organization/repository"
128+
)
113129

114130
parser.add_argument(
115131
"--exclude-label",
116132
dest="exclude_label",
117133
action="append",
118134
type=str,
119-
help="Exclude all issues and PRs with the specified label",)
135+
help="Exclude all issues and PRs with the specified label"
136+
)
120137

121138
parser.add_argument(
122139
"--publish-board",
123140
dest="publish_board",
124141
action="store_const",
125-
help="The organization/board to publish (add) the collection of GitHub Issues and Pull Requests",)
142+
help="The organization/board to publish (add) the collection of GitHub Issues and Pull Requests"
143+
)
126144

127145
parsed_args = parser.parse_args()
128146

129-
self.include_user = parsed_args.include_user
147+
self.output_file = parsed_args.output_file
148+
self.temp_dir = parsed_args.temp_dir
130149
self.include_team = parsed_args.include_team
150+
self.include_user = parsed_args.include_user
131151
self.include_repository = parsed_args.include_repository
152+
self.include_organization = parsed_args.include_organization
132153
self.include_organization_repository = parsed_args.include_organization_repository
133154
self.include_label = parsed_args.include_label
134-
self.exclude_organization = parsed_args.exclude_organization
155+
self.exclude_team = parsed_args.exclude_team
156+
self.exclude_user = parsed_args.exclude_user
135157
self.exclude_repository = parsed_args.exclude_repository
158+
self.exclude_organization = parsed_args.exclude_organization
136159
self.exclude_organization_repository = parsed_args.exclude_organization_repository
137-
self.exclude_user = parsed_args.exclude_user
138160
self.exclude_label = parsed_args.exclude_label
139-
self.exclude_team = parsed_args.exclude_team
140161
self.publish_board = parsed_args.publish_board
141-
self.output_file = parsed_args.output_file
142-
self.temp_dir = parsed_args.temp_dir
143162

144163
def init_logger(self):
145164
logging.basicConfig(level=self.LOG_LEVEL, format=self.LOG_FORMAT)
@@ -151,15 +170,16 @@ def display_config(self):
151170
logging.info("Configuration:")
152171
logging.info(f"Output File: {self.output_file}")
153172
logging.info(f"Temporary Directory: {self.temp_dir}")
173+
logging.info(f"Include Team: {self.include_team}")
154174
logging.info(f"Include User: {self.include_user}")
155175
logging.info(f"Include Repository: {self.include_repository}")
176+
logging.info(f"Include Organization: {self.include_organization}")
156177
logging.info(f"Include Organization/Repository: {self.include_organization_repository}")
157178
logging.info(f"Include Label: {self.include_label}")
158-
logging.info(f"Include Team: {self.include_team}")
159-
logging.info(f"Exclude Organization: {self.exclude_organization}")
179+
logging.info(f"Exclude Team: {self.exclude_team}")
180+
logging.info(f"Exclude User: {self.exclude_user}")
160181
logging.info(f"Exclude Repository: {self.exclude_repository}")
182+
logging.info(f"Exclude Organization: {self.exclude_organization}")
161183
logging.info(f"Exclude Organization/Repository: {self.exclude_organization_repository}")
162-
logging.info(f"Exclude User: {self.exclude_user}")
163184
logging.info(f"Exclude Label: {self.exclude_label}")
164-
logging.info(f"Exclude Team: {self.exclude_team}")
165185
logging.info(f"Publish Board: {self.publish_board}")

0 commit comments

Comments
 (0)