Skip to content

chore: update the order of CLI args and documentation #53

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
29 changes: 18 additions & 11 deletions current-implemented-CLI.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,18 +2,25 @@

## Currently Implemented

- `include-team` - Include a team to the query
- `output-file` - Define the filename and location of the output file
- `temp-dir` - The temporary directory to write JSON response files

- `include-team` - Include a team to the query


## To Be Implemented

- `include_user` - Include a specific user to the query
- `include_repository` - Include specific repo(s) to the query
- `include_organization_repository` - Include specific org(s) repo(s) to the query
- `include_label` - Include a specific label to the query
- `exclude_organization` - Exclude specific org(s) from the output
- `exclude_repository` - Exclude specific repo(s) from the output
- `exclude_organization_repository` - Exclude specific org(s) repo(s) from the output
- `exclude_user` - Exclude specific user from the output
- `exclude_label` - Exclude issues with specific label from the output
- `publish_board` - Copy output of script to a common board in GitHub by using the GH API
- `include-user` - Include a specific user to the query
- `include-repository` - Include specific repo to the query
- `include-organization` - Include specific org to a query
- `include-organization-repository` - Include specific org/repo to the query
- `include-label` - Include a specific label to the query

- `exclude-team` - Exclude specific team from the output
- `exclude-user` - Exclude specific user from the output
- `exclude-repository` - Exclude specific repo from the output
- `exclude-organization` - Exclude specific org from the output
- `exclude-organization-repository` - Exclude specific org/repo from the output
- `exclude-label` - Exclude issues with specific label from the output

- `publish-board` - Copy output of script to a common board in GitHub by using the GH API
104 changes: 62 additions & 42 deletions src/version2config.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,15 @@ def init_parser(self):
action="store",
type=str,
default="tmp.dir",
help="The temporary directory to store the json data files",
help="The temporary directory to store the json data files"
)

parser.add_argument(
"--include-team",
dest="include_team",
action="append",
type=str,
help="Include provided teams in the output"
)

parser.add_argument(
Expand All @@ -43,103 +51,114 @@ def init_parser(self):
action="append",
type=str,
nargs="+",
help="Include all issues and PRs for the provided user [Required Parameter]",)

parser.add_argument(
"--include-team",
dest="include_team",
action="append",
type=str,
help="Include provided teams in the output"
help="Include all issues and PRs for the provided user [Required Parameter]"
)

parser.add_argument(
"--exclude-team",
dest="exclude_team",
action="append",
type=str,
help="Exclude provided teams in the output"
"--include-repository",
dest="include_repository",
action="append",
type=str,
help="Include all issues and PRs from the specified repository"
)

parser.add_argument(
"--include-repository",
dest="include_repository",
"--include-organization",
dest="include_organization",
action="append",
type=str,
help="Include all issues and PRs from the specified repository",)
help="Include all issues and PRs from the specified organization"
)

parser.add_argument(
"--include-organization-repository",
dest="include_organization_repository",
action="append",
type=str,
help="Include all issues and PRs from the specified organization/repository",)
help="Include all issues and PRs from the specified organization/repository"
)

parser.add_argument(
"--include-label",
dest="include_label",
action="append",
type=str,
help="Include all issues and PRs with the specified label",)
help="Include all issues and PRs with the specified label"
)

parser.add_argument(
"--exclude-organization",
dest="exclude_organization",
"--exclude-team",
dest="exclude_team",
action="append",
type=str,
help="Exclude provided teams in the output"
)

parser.add_argument(
"--exclude-user",
dest="exclude_user",
action="append",
type=str,
help="Exclude all issues and PRs from the specified organization",)
help="Exclude all issues and PRs for the provided user"
)

parser.add_argument(
"--exclude-repository",
dest="exclude_repository",
action="append",
type=str,
help="Exclude all issues and PRs from the specified repository",)
help="Exclude all issues and PRs from the specified repository"
)

parser.add_argument(
"--exclude-organization-repository",
dest="exclude_organization_repository",
"--exclude-organization",
dest="exclude_organization",
action="append",
type=str,
help="Exclude all issues and PRs from the specified "
"organization/repository",)
help="Exclude all issues and PRs from the specified organization"
)

parser.add_argument(
"--exclude-user",
dest="exclude_user",
"--exclude-organization-repository",
dest="exclude_organization_repository",
action="append",
type=str,
help="Exclude all issues and PRs for the provided user",)
help="Exclude all issues and PRs from the specified "
"organization/repository"
)

parser.add_argument(
"--exclude-label",
dest="exclude_label",
action="append",
type=str,
help="Exclude all issues and PRs with the specified label",)
help="Exclude all issues and PRs with the specified label"
)

parser.add_argument(
"--publish-board",
dest="publish_board",
action="store_const",
help="The organization/board to publish (add) the collection of GitHub Issues and Pull Requests",)
help="The organization/board to publish (add) the collection of GitHub Issues and Pull Requests"
)

parsed_args = parser.parse_args()

self.include_user = parsed_args.include_user
self.output_file = parsed_args.output_file
self.temp_dir = parsed_args.temp_dir
self.include_team = parsed_args.include_team
self.include_user = parsed_args.include_user
self.include_repository = parsed_args.include_repository
self.include_organization = parsed_args.include_organization
self.include_organization_repository = parsed_args.include_organization_repository
self.include_label = parsed_args.include_label
self.exclude_organization = parsed_args.exclude_organization
self.exclude_team = parsed_args.exclude_team
self.exclude_user = parsed_args.exclude_user
self.exclude_repository = parsed_args.exclude_repository
self.exclude_organization = parsed_args.exclude_organization
self.exclude_organization_repository = parsed_args.exclude_organization_repository
self.exclude_user = parsed_args.exclude_user
self.exclude_label = parsed_args.exclude_label
self.exclude_team = parsed_args.exclude_team
self.publish_board = parsed_args.publish_board
self.output_file = parsed_args.output_file
self.temp_dir = parsed_args.temp_dir

def init_logger(self):
logging.basicConfig(level=self.LOG_LEVEL, format=self.LOG_FORMAT)
Expand All @@ -151,15 +170,16 @@ def display_config(self):
logging.info("Configuration:")
logging.info(f"Output File: {self.output_file}")
logging.info(f"Temporary Directory: {self.temp_dir}")
logging.info(f"Include Team: {self.include_team}")
logging.info(f"Include User: {self.include_user}")
logging.info(f"Include Repository: {self.include_repository}")
logging.info(f"Include Organization: {self.include_organization}")
logging.info(f"Include Organization/Repository: {self.include_organization_repository}")
logging.info(f"Include Label: {self.include_label}")
logging.info(f"Include Team: {self.include_team}")
logging.info(f"Exclude Organization: {self.exclude_organization}")
logging.info(f"Exclude Team: {self.exclude_team}")
logging.info(f"Exclude User: {self.exclude_user}")
logging.info(f"Exclude Repository: {self.exclude_repository}")
logging.info(f"Exclude Organization: {self.exclude_organization}")
logging.info(f"Exclude Organization/Repository: {self.exclude_organization_repository}")
logging.info(f"Exclude User: {self.exclude_user}")
logging.info(f"Exclude Label: {self.exclude_label}")
logging.info(f"Exclude Team: {self.exclude_team}")
logging.info(f"Publish Board: {self.publish_board}")