Lilypad-Tech / lilypad

Run AI workloads easily in a decentralized GPU network. https://www.youtube.com/watch?v=yQnB2Yxia4Y
https://lilypad.tech
Apache License 2.0
53 stars 17 forks source link

Silence help text on run errors #413

Open bgins opened 1 month ago

bgins commented 1 month ago

We currently print the help text on every command failure. Printing usage information is great when an error occurs parsing CLI options. However, it's noisy and unhelpful for errors reported afterwards.

Let's silence the help text after we have parsed CLI options. For example, in the run subcommand:

https://github.com/Lilypad-Tech/lilypad/blob/b467d0fa36f9720038bf5714d7ce1409a375d2a8/cmd/lilypad/run.go#L33-L37

we could set cmd.SilenceUsage to true after handling any ProcessJobCreatorOptions errors.

The silenced error output can be tested by temporarily returning an error from the first line of the runJob function:

https://github.com/Lilypad-Tech/lilypad/blob/b467d0fa36f9720038bf5714d7ce1409a375d2a8/cmd/lilypad/run.go#L46-L47

gurkin2005 commented 3 weeks ago

I would like to work on this