[GH-ISSUE #86] --version commandline parsing error #27

Closed
opened 2026-03-03 01:21:15 +03:00 by kerem · 5 comments
Owner

Originally created by @antenore on GitHub (Aug 31, 2021).
Original GitHub issue: https://github.com/cs01/termpair/issues/86

Thanks for TermPair, it's an amazing project!

Describe the bug

$ termpair --version
usage: termpair [-h] [--version] {share,serve} ...
termpair: error: the following arguments are required: command

termpair doesn't parse correctly --version expecting other arguments and options

I've installed the latest version with pip, with python 3.9

Originally created by @antenore on GitHub (Aug 31, 2021). Original GitHub issue: https://github.com/cs01/termpair/issues/86 Thanks for TermPair, it's an amazing project! **Describe the bug** ``` $ termpair --version usage: termpair [-h] [--version] {share,serve} ... termpair: error: the following arguments are required: command ``` `termpair` doesn't parse correctly `--version` expecting other arguments and options I've installed the latest version with pip, with python 3.9
kerem 2026-03-03 01:21:15 +03:00
Author
Owner

@antenore commented on GitHub (Aug 31, 2021):

From a totally Python n00b like me, looking at the code, it sounds like it's an intended behavior?

https://github.com/cs01/termpair/blob/master/termpair/main.py#L24

I'd expect --version to print the version and awlays silently exit.

<!-- gh-comment-id:908914414 --> @antenore commented on GitHub (Aug 31, 2021): From a totally Python n00b like me, looking at the code, it sounds like it's an intended behavior? https://github.com/cs01/termpair/blob/master/termpair/main.py#L24 I'd expect `--version` to print the version and awlays silently exit.
Author
Owner

@cs01 commented on GitHub (Aug 31, 2021):

Thanks for filing. Ugh, no it’s not intended. I will fix this. If you feel like giving it a shot and making a PR feel free, otherwise I will take care of it.

<!-- gh-comment-id:908915739 --> @cs01 commented on GitHub (Aug 31, 2021): Thanks for filing. Ugh, no it’s not intended. I will fix this. If you feel like giving it a shot and making a PR feel free, otherwise I will take care of it.
Author
Owner

@cs01 commented on GitHub (Aug 31, 2021):

The fix is to use the ‘version’ action

https://docs.python.org/dev/library/argparse.html#action

<!-- gh-comment-id:908917303 --> @cs01 commented on GitHub (Aug 31, 2021): The fix is to use the ‘version’ action https://docs.python.org/dev/library/argparse.html#action
Author
Owner

@antenore commented on GitHub (Aug 31, 2021):

:-D Cool, I was preparing a PR as well , you are too fast!! :-)

Thanks a lot, my PR was miising the tests and all the rest

<!-- gh-comment-id:908931578 --> @antenore commented on GitHub (Aug 31, 2021): :-D Cool, I was preparing a PR as well , you are too fast!! :-) Thanks a lot, my PR was miising the tests and all the rest
Author
Owner

@cs01 commented on GitHub (Aug 31, 2021):

Sorry for the whiplash there. I was thinking I wouldn't get to this for a couple days but I decided to just knock it out. I appreciate you putting together the PR. If you find any other bugs I promise I won't fix them too fast :).

<!-- gh-comment-id:908934325 --> @cs01 commented on GitHub (Aug 31, 2021): Sorry for the whiplash there. I was thinking I wouldn't get to this for a couple days but I decided to just knock it out. I appreciate you putting together the PR. If you find any other bugs I promise I won't fix them too fast :).
Sign in to join this conversation.
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
starred/termpair#27
No description provided.