Skip to content
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

Fix parsing and display of backend-specific help messages #847

Merged
merged 1 commit into from
Aug 13, 2024

Conversation

vchrombie
Copy link
Member

@vchrombie vchrombie commented Aug 12, 2024

Fixes #799

I took a stab at this bug, by setting the prog attribute inside the BackendCommand's __init__ method, you ensure that the program name (prog) is set correctly when each backend is initialized. This should fix the issue with any backend.

$ perceval github -h
[2024-08-12 17:42:02,923] - Sir Perceval is on his quest.
usage: perceval github [-h] [--category CATEGORY] [--tag TAG] [--filter-classified] [--from-date FROM_DATE] [--to-date TO_DATE] [--archive-path ARCHIVE_PATH] [--no-archive] [--fetch-archive]
                       [--archived-since ARCHIVED_SINCE] [--no-ssl-verify] [-o OUTFILE] [--json-line] [--enterprise-url BASE_URL] [--sleep-for-rate] [--min-rate-to-sleep MIN_RATE_TO_SLEEP]
                       [-t API_TOKEN [API_TOKEN ...]] [--github-app-id GITHUB_APP_ID] [--github-app-pk-filepath GITHUB_APP_PK_FILEPATH] [--max-items MAX_ITEMS] [--max-retries MAX_RETRIES]
                       [--sleep-time SLEEP_TIME]
                       owner repository
$ perceval jira -h
[2024-08-12 17:44:02,305] - Sir Perceval is on his quest.
usage: perceval jira [-h] [--category CATEGORY] [--tag TAG] [--filter-classified] [--from-date FROM_DATE] [-u USER] [-p PASSWORD] [-t API_TOKEN] [--archive-path ARCHIVE_PATH] [--no-archive]
                     [--fetch-archive] [--archived-since ARCHIVED_SINCE] [--no-ssl-verify] [-o OUTFILE] [--json-line] [--project PROJECT] [--cert CERT] [--max-results MAX_RESULTS]
                     url

Do you think you need any tests for this change?

I am trying to see if I can fix the args order.
I guess it cannot be fixed, check #799 (comment)

I will add the changelog file when I finish the PR.
Added

@vchrombie vchrombie force-pushed the 799-fix/backend-parser-usage branch from 26eb44b to e71ac87 Compare August 13, 2024 04:34
Copy link
Member

@sduenas sduenas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM. Thanks for the PR!

@sduenas sduenas merged commit 7e48bf0 into chaoss:master Aug 13, 2024
6 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Incorect "usage" argument order for github backend
2 participants