Skip to content

Commit

Permalink
up: ext flag vars use the goutil/cflag.ext_vars instead
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Oct 16, 2022
1 parent 2490e60 commit f54ac5a
Show file tree
Hide file tree
Showing 3 changed files with 19 additions and 140 deletions.
11 changes: 6 additions & 5 deletions gcli.go
Original file line number Diff line number Diff line change
Expand Up @@ -17,6 +17,7 @@ import (
"strings"

"github.com/gookit/gcli/v3/gflag"
"github.com/gookit/goutil/cflag"
"github.com/gookit/goutil/envutil"
)

Expand Down Expand Up @@ -243,16 +244,16 @@ func IsDebugMode() bool { return gOpts.Verbose >= VerbDebug }
*************************************************************************/

// Ints The int flag list, implemented flag.Value interface
type Ints = gflag.Ints
type Ints = cflag.Ints

// Strings The string flag list, implemented flag.Value interface
type Strings = gflag.Strings
type Strings = cflag.Strings

// Booleans The bool flag list, implemented flag.Value interface
type Booleans = gflag.Booleans
type Booleans = cflag.Booleans

// EnumString The string flag list, implemented flag.Value interface
type EnumString = gflag.EnumString
type EnumString = cflag.EnumString

// String type, a special string
//
Expand All @@ -271,7 +272,7 @@ type EnumString = gflag.EnumString
//
// --names "23,34,56"
// names.Ints(",") -> []int{23,34,56}
type String = gflag.String
type String = cflag.String

/*************************************************************************
* Verbose level
Expand Down
135 changes: 0 additions & 135 deletions gflag/ext_vars.go

This file was deleted.

13 changes: 13 additions & 0 deletions gflag/gflag.go
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,7 @@
package gflag

import (
"github.com/gookit/goutil/cflag"
"github.com/gookit/goutil/strutil"
)

Expand Down Expand Up @@ -50,3 +51,15 @@ type OptCategory struct {
Name, Title string
OptNames []string
}

// Ints The int flag list, implemented flag.Value interface
type Ints = cflag.Ints

// Strings The string flag list, implemented flag.Value interface
type Strings = cflag.Strings

// Booleans The bool flag list, implemented flag.Value interface
type Booleans = cflag.Booleans

// EnumString The string flag list, implemented flag.Value interface
type EnumString = cflag.EnumString

0 comments on commit f54ac5a

Please sign in to comment.