cobra
cobra copied to clipboard
Completion and sudo
Hi,
For nerdctl, we are interested in displaying different completion if called with sudo vs. called directly. (https://github.com/containerd/nerdctl/issues/99 ).
Do you have a recommendation on how to implement this / approach this problem?
I assume we would have to patch: https://github.com/spf13/cobra/blob/v1.8.1/bash_completionsV2.go#L84 to call with sudo if needed.
But then, how do we decide that? Use _complete_as_root
to test?
Thanks a lot.