We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 1b2301f commit 7c9fe92Copy full SHA for 7c9fe92
command_test.go
@@ -552,11 +552,22 @@ func TestCommand_RootRaw(t *testing.T) {
552
553
func TestCommand_HyphenHyphen(t *testing.T) {
554
t.Parallel()
555
+ var verbose bool
556
cmd := &serpent.Command{
557
Handler: (func(i *serpent.Invocation) error {
558
_, _ = i.Stdout.Write([]byte(strings.Join(i.Args, " ")))
559
+ if verbose {
560
+ return xerrors.New("verbose should not be true because flag after --")
561
+ }
562
return nil
563
}),
564
+ Options: serpent.OptionSet{
565
+ {
566
+ Name: "verbose",
567
+ Flag: "verbose",
568
+ Value: serpent.BoolOf(&verbose),
569
+ },
570
571
}
572
573
inv := cmd.Invoke("--", "--verbose", "--friendly")
0 commit comments