Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

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

Closed
dandavison opened this issue Mar 11, 2024 · 2 comments
Closed

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

dandavison opened this issue Mar 11, 2024 · 2 comments
Labels
bug Something isn't working

Comments

@dandavison
Copy link
Contributor

$ /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
@dandavison dandavison added the bug Something isn't working label Mar 11, 2024
@lorensr
Copy link
Contributor

lorensr commented Mar 28, 2024

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

@josh-berry
Copy link
Collaborator

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...

josh-berry added a commit that referenced this issue Apr 5, 2024
We want a non-zero exit when the user invokes `temporal` with an unknown
command/subcommand, or when invoked with no arguments.  But if the user
explicitly asks for help, we should print it and return success.

Closes #495.
josh-berry added a commit that referenced this issue Apr 8, 2024
We want a non-zero exit when the user invokes `temporal` with an unknown
command/subcommand, or when invoked with no arguments. But if the user
explicitly asks for help or version information, we should print it and
return success.

Closes #495.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

3 participants