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

Inconsistent exit codes #120

Open
chelliwell opened this issue Jun 19, 2020 · 1 comment
Open

Inconsistent exit codes #120

chelliwell opened this issue Jun 19, 2020 · 1 comment

Comments

@chelliwell
Copy link

For scripting the use of stellarcli, the exit codes can be pretty important. I've noticed some variability though when commands are wrongly constructed:
stellarcli.exe satellite open-strea 5 => 0
stellarcli.exe satellit open-stream 5 => 1
stellarcli.exe blah open-stream 5 => 1
stellarcli.exe blah => 1
stellarcli.exe satellite blah => 0
stellarcli.exe satellite open-stream -blah => 1

I think it maybe depends on whether or not it drops through to a 'help' message. Perhaps need to differentiate between "help because the command wasn't understood" vs. "help because of the --help"?
Simple answer, of course, don't construct bad commands...! ;)
But when/if the command line options evolve over time, it would be good if a script can spot a flagrant mistake.

@davidk81
Copy link
Contributor

Thanks for your feedback. This seems to be caused by cobra library used to parse commands. I found open issues spf13/cobra#749 and spf13/cobra#582

I've also tested a stellarcli build with cobra 1.0.0 release, but the problem still seem to exist.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants