tldr-pages / tldr-python-client

:snake: Python command-line client for tldr pages 📚
https://pypi.org/project/tldr/
MIT License
599 stars 95 forks source link

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

Closed MasterOdin closed 3 years ago

MasterOdin commented 3 years ago

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.