troubleshoot: RFE (small suggestion): Error faced when we run `kubectl preflight` does not clarifies what is missing and why
Describe the rationale for the suggested feature.
If we install troubleshoot and run kubectl preflight to check it is ok the following error is returned which can bring confusion and does not let us know what is properly missing and why, or if the tool is properly installed.
$ kubectl preflight Error: requires at least 1 arg(s), only received 0
Describe the feature
Why the URL is required as arg? Could I am as user use any other value that is not https://preflight.replicated.com?
What about simplify its usage by:
- Using flag instead of arg to pass the URL
https://preflight.replicated.com - If the URL not to be set, then its default value will be used which would be a constant with
https://preflight.replicated.com
So that, I can run the command with kubectl preflight only.
Describe alternatives you’ve considered
Return a better message so that we can clarifies that it is missing a URL with its default value.
About this issue
- Original URL
- State: open
- Created 2 years ago
- Comments: 17 (17 by maintainers)
It just occurred to me that we did not address the original problem which was ambiguity of the error message seen in a CLI is run with no arguments.
Are we happy with printing the usage text if there are no arguments passed in as I had described https://github.com/replicatedhq/troubleshoot/issues/824#issuecomment-1317338529?
I think that’s a good objective, We’d then have
./bin/<cmd> <spec> <options>Would adding the following two changes improve the situation?
--helpoutput whenever there are errors parsing cli flagsExample