SIGN IN SIGN UP
spf13 / cobra UNCLAIMED

A Commander for modern Go CLI interactions

0 0 142 Go

Include --help and --version flag in completion (#1813)

Fixes #1786

The --help, -h, --version and -v flags are normally added when the
`execute()` function is called on a command.  When doing completion
we don't call `execute()` so we need to add these flags explicitly to
the command being completed.

Also, we disable all further completions if the 'help' or 'version'
flags are present on the command-line.

Signed-off-by: Marc Khouzam <marc.khouzam@gmail.com>
M
Marc Khouzam committed
212ea4078323771dc49b6f25a41d84efbaac3a4c
Parent: d4040ad
Committed by GitHub <noreply@github.com> on 10/4/2022, 10:41:30 PM