Open shirady opened 1 year ago
@shirady I think --help has the answer:
❯ noobaa completion --help
Load noobaa completion to bash:
(add to your ~/.bashrc and ~/.bash_profile to auto load)
. <(noobaa completion)
Options:
--alias='': Custom alias name to generate the completion for
Usage:
noobaa completion [flags] [options]
Use "noobaa options" for a list of global command-line options (applies to all commands).
@guymguym I don't understand what should I do to use it right... (but it's a different thing).
Anyway, in the case where the user uses it wrong (just nb completion
without any prior step), I think it should print him an error and not the script in the terminal.
It prints the shell completion script to be sourced into your shell.
This is the pattern used by many tools, for example kubectl.
But what you could do, is make the "completion" subcommand have subcommands of its own like kubectl completion does, so that noobaa completion bash
will be the command that prints the script to stdout, and the "bare" noobaa completion
command will just show help.
BTW is this description not helpful?
Load noobaa completion to bash:
(add to your ~/.bashrc and ~/.bash_profile to auto load)
. <(noobaa completion)
@shirady do you feel the last 2 comments are solving the problem?
@nimrod-becker, no...
Environment info
CLI version: 5.13.0 noobaa-image: noobaa/noobaa-core:master-20220913 operator-image: noobaa/noobaa-operator:5.13.0
Actual behavior
Expected behavior
Steps to reproduce
nb completion
nb acc
+ tab in order to completenb account
More information - Screenshots / Logs / Other output