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

ipfs-cluster-ctl should not return error code 0 in case of incorrect usage #1633

Closed
gdethier opened this issue Apr 12, 2022 · 2 comments · Fixed by #1634
Closed

ipfs-cluster-ctl should not return error code 0 in case of incorrect usage #1633

gdethier opened this issue Apr 12, 2022 · 2 comments · Fixed by #1634
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization

Comments

@gdethier
Copy link

Additional information:

  • OS: Ubuntu 21.10
  • IPFS Cluster version: 0.14.5
  • Installation method: dist.ipfs.io

Describe the bug:
When calling ipfs-cluster-ctl with invalid arguments (e.g. ipfs-cluster-ctl add some-file.txt -rmin NaN), an error message is shown (e.g. Incorrect Usage: invalid value "NaN" for flag -rmin: parse error) followed by the program's usage string. In that case, the error code is 0 and everything is output to stdout.

I would expect a return code different from 0, which is particularly important if you use that command in a script.

I see that error codes 1 and 2 are already in use but for another purpose (#178), maybe add an error code 3 for input related issues?

@gdethier gdethier added kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization labels Apr 12, 2022
@welcome
Copy link

welcome bot commented Apr 12, 2022

Thank you for submitting your first issue to this repository! A maintainer will be here shortly to triage and review.
In the meantime, please double-check that you have provided all the necessary information to make this process easy! Any information that can help save additional round trips is useful! We currently aim to give initial feedback within two business days. If this does not happen, feel free to leave a comment.
Please keep an eye on how this issue will be labeled, as labels give an overview of priorities, assignments and additional actions requested by the maintainers:

  • "Priority" labels will show how urgent this is for the team.
  • "Status" labels will show if this is ready to be worked on, blocked, or in progress.
  • "Need" labels will indicate if additional input or analysis is required.

Finally, remember to use https://discuss.ipfs.io if you just need general support.

@hsanjuan hsanjuan linked a pull request Apr 12, 2022 that will close this issue
@hsanjuan
Copy link
Collaborator

Thank you, indeed per the docs it should return with 1 (argument error).

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
kind/bug A bug in existing code (including security flaws) need/triage Needs initial labeling and prioritization
Projects
None yet
Development

Successfully merging a pull request may close this issue.

2 participants