tldr-pages / tldr-c-client

C command-line client for tldr pages
MIT License
293 stars 50 forks source link

Fix print_usage and man page mistakes #103

Closed 4G3NT closed 7 months ago

4G3NT commented 1 year ago

Usage string is off and this PR fixes it.

SethFalco commented 1 year ago

Just for context, I checked what the client specifications had on this just to make sure we're changing the correct thing.

Indeed, -v should be for --version.

4G3NT commented 11 months ago

Turns out that other options, such as --verbose and --version, do exist, on top of -l being non-existent.

img

4G3NT commented 11 months ago

Hopefully this will be the last commit. :slightly_smiling_face:

4G3NT commented 11 months ago

If I have time, I can rewrite the arguments so that --version is the only flag, and -v, --verbose is used for verbose.

4G3NT commented 11 months ago

Not sure what to do with the current usage string. Maybe it should be:

tldr [OPTION] PAGE

or tldr [ --verbose] [-c|-u] [OPTION]... PAGE

But the problem is it doesn't cover options like --render, which takes a file path, for example.

4G3NT commented 11 months ago

Reverting to the old usage but using tldr [--verbose] [OPTION]... PAGE is much better IMO.

4G3NT commented 7 months ago

And now when you invoke tldr with -r it will output:

$ tldr -r
./tldr: option requires an argument -- 'r'

instead of the last code:

$ tldr -r
tldr: option '-render' requires an argument
sbrl commented 7 months ago

Not sure who is generally responsible for the c client but this seems ready to merge for me.