Skip to content

gh-107467: Restructure Argument Clinic command-line interface - #107469

Merged
erlend-aasland merged 8 commits into
python:mainfrom
erlend-aasland:clinic/rework-cli
Aug 1, 2023
Merged

gh-107467: Restructure Argument Clinic command-line interface#107469
erlend-aasland merged 8 commits into
python:mainfrom
erlend-aasland:clinic/rework-cli

Conversation

@erlend-aasland

@erlend-aaslanderlend-aasland commented Jul 30, 2023

Copy link
Copy Markdown
Contributor
  • Add and use CLIError exception for CLI usage errors
  • On CLI error, print to stderr instead of stdout
  • Put the entire CLI in main()
  • Rework ClinicExternalTest to call main() instead of using subprocesses

- Add and use CLIError exception for CLI usage errors
- On CLI error, print to stderr instead of stdout
- Put the entire CLI in main()
- Rework ClinicExternalTest to call main() instead of using subprocesses
@erlend-aaslanderlend-aasland changed the title clinic/rework cligh-107467: Restructure Argument Clinic command-line interfaceJul 30, 2023
@bedevere-botbedevere-bot mentioned this pull request Jul 30, 2023
3 tasks
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

@AlexWaygood, are you fine with this?

@AlexWaygood

Copy link
Copy Markdown
Member

@AlexWaygood, are you fine with this?

Haven't had a chance to look deeply yet, and would like to! :)

@AlexWaygood

Copy link
Copy Markdown
Member

I think some of this is reinventing the wheel a little bit, and can be simplified by making use of the ArgumentParser.error() method. I filed erlend-aasland#48 as a PR to your branch!

@AlexWaygoodAlexWaygood left a comment

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

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

LGTM! Feel free to merge if you're happy with the changes I pushed :)

Comment threadTools/clinic/clinic.py
@erlend-aasland

Copy link
Copy Markdown
ContributorAuthor

Thanks for the argparse error trick; I was unaware of that :) Let's land this and continue with the error handling refactoring.

@erlend-aasland
erlend-aasland merged commit 49f238e into python:mainAug 1, 2023
@erlend-aasland
erlend-aasland deleted the clinic/rework-cli branch August 1, 2023 16:24
@bedevere-bot

This comment was marked as off-topic.

Sign up for freeto 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.

3 participants

@erlend-aasland@AlexWaygood@bedevere-bot