temporalio / cli

Command-line interface for running Temporal Server and interacting with Workflows, Activities, Namespaces, and other parts of Temporal
https://docs.temporal.io/cli
MIT License
247 stars 34 forks source link

[Bug] --version and --help are exiting with failure code #495

Closed dandavison closed 5 months ago

dandavison commented 5 months ago
$ /Users/dan/src/temporalio/cli/temporal-new --version > /dev/null; echo $?
unknown command
1

$ /Users/dan/src/temporalio/cli/temporal-new --help > /dev/null; echo $?
unknown command
1
lorensr commented 5 months ago

Would also be nice if it didn't print unknown command

josh-berry commented 5 months ago

I spent some time looking into this, and I don't think it's easily fixable unless the following two Cobra issues are fixed:

I there's a hack we can put in to detect if help text is being displayed, and use that to exit 0, but it would require not printing help text on an invalid subcommand, and I haven't yet figured out how to control that behavior. (I've been poking at this in between meetings and such so haven't really given it a lot of focused attention though.)

tl;dr Still looking...