Skip to content

Commit

Permalink
feat(xcli): bool value 特做
Browse files Browse the repository at this point in the history
  • Loading branch information
Ccheers committed Oct 17, 2024
1 parent 64e8e6f commit 456e225
Showing 1 changed file with 4 additions and 0 deletions.
4 changes: 4 additions & 0 deletions xcli/define.go
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,7 @@ package xcli
import (
"context"
"flag"
"reflect"

"github.com/spf13/cobra"
"github.com/spf13/pflag"
Expand Down Expand Up @@ -50,6 +51,9 @@ func (x *pflagValueAdapter) Set(s string) error {
}

func (x *pflagValueAdapter) Type() string {
if reflect.TypeOf(x.value).Name() == "boolValue" {
return "bool"
}
return "string"
}

Expand Down

0 comments on commit 456e225

Please sign in to comment.