Skip to content

Set --help usage line to match node client #149

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 2 commits into from
Dec 28, 2020
Merged

Set --help usage line to match node client #149

merged 2 commits into from
Dec 28, 2020

Conversation

MasterOdin
Copy link
Collaborator

The current usage text for the client is:

usage: tldr [-u] [-p PLATFORM] [-l] [-s SOURCE] [-c] [-r] [-L LANGUAGE] command

This works, but is cumbersome to add more options to as the string is manually configured, and making sure the flags match their string, etc.

The switch for using the manually created string instead of relying on argparse was done in #116, with the reason that command would show up as optional and many part ([command, ...]) because of the nargs='*' on it. This is confusing though as command is only optional when using --update_cache, and then otherwise required. Hence the manually set string.

The node client on the other hand does:

Usage: tldr command [options]

This is preferable imo to our current approach as we then let argparse to show our options below automatically and we should never have to touch the usage string again.

@MasterOdin MasterOdin merged commit daf1ebf into master Dec 28, 2020
@MasterOdin MasterOdin deleted the usage_string branch December 28, 2020 16:34
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.

2 participants