telepresence
telepresence copied to clipboard
add completion subcommand
Signed-off-by: Raphael Reyna [email protected]
Description
Adds a completion
subcommand to generate a completion script for the given shell (addresses #538).
Also adds the line see 'telepresence <subcommand_name> -h' for help
on errcat.User
errors.
Checklist
- [x] I made sure to update
./CHANGELOG.md
. - [x] I made sure to add any docs changes required for my change (including release notes).
- [x] My change is adequately tested.
- [ ] I updated
DEVELOPING.md
with any any special dev tricks I had to use to work on this code efficiently. - [ ] I updated
TELEMETRY.md
if I added, changed, or removed a metric name. - [ ] Once my PR is ready to have integration tests ran, I posted the PR in #telepresence-dev in the datawire-oss slack so that the "ok to test" label can be applied.
out of curiosity, what does the default completion generation look like?
out of curiosity, what does the default completion generation look like?
@jef, do you mean if no shell is passed as an argument (just running telepresence completion
)?
if so then the user gets the message:
telepresence: error: shell not specified
see 'telepresence completion -h' for help
sorry for being vague. what i mean is: isn't there an implementation built-in without your addCompletionCommand(rootCmd)
function? i ask only because i've written some (much smaller) cobra cli tools that didn't need much to generate. that said, perhaps this extends it much more! thanks 😌
sorry for being vague. what i mean is: isn't there an implementation built-in without your
addCompletionCommand(rootCmd)
function? i ask only because i've written some (much smaller) cobra cli tools that didn't need much to generate. that said, perhaps this extends it much more! thanks relieved
ah, yeah this was a feature of the cobra cli tool that I believe is no longer supported.
I believe is no longer supported.
makes a lot more sense! 😅 thanks for your feedback 😊