mirror of
https://github.com/spf13/cobra
synced 2024-11-04 21:07:19 +00:00
20 lines
406 B
Bash
20 lines
406 B
Bash
|
package cobra
|
||
|
|
||
|
import (
|
||
|
"bytes"
|
||
|
"fmt"
|
||
|
"testing"
|
||
|
)
|
||
|
|
||
|
func TestBashCompletionV2WithActiveHelp(t *testing.T) {
|
||
|
c := &Command{Use: "c", Run: emptyRun}
|
||
|
|
||
|
buf := new(bytes.Buffer)
|
||
|
assertNoErr(t, c.GenBashCompletionV2(buf, true))
|
||
|
output := buf.String()
|
||
|
|
||
|
// check that active help is not being disabled
|
||
|
activeHelpVar := activeHelpEnvVar(c.Name())
|
||
|
checkOmit(t, output, fmt.Sprintf("%s=0", activeHelpVar))
|
||
|
}
|