jsdelivr / globalping-cli

A simple CLI tool to run networking commands remotely from hundreds of globally distributed servers
Mozilla Public License 2.0
118 stars 14 forks source link

Improve error handling v2 #115

Closed MartinKolarik closed 1 month ago

MartinKolarik commented 1 month ago

Partly related to #106.

Currently, when I use a command incorrectly, there's an error followed by the (long) help text, so I can't actually see the error and need to scroll up for it:

image

=>

image

This gets quite annoying as the error message is usually more useful for fixing the problem than the help text. In comparison, curl only prints the error and a hint to run curl --help for the help:

image

How about we do it similarly and print Run 'globalping --help' for more information. In case the error happened with a specific sub-command, the message would include that command, e.g. Run 'globalping ping --help' for more information.

MartinKolarik commented 1 month ago

@radulucut please: