Feature: (issue_1451) customized slice flag separator (#1546)
* feat: customized slice flag separator * feat: modify go doc * feat: update unit test
This commit is contained in:
6
app.go
6
app.go
@@ -103,6 +103,8 @@ type App struct {
|
||||
// cli.go uses text/template to render templates. You can
|
||||
// render custom help text by setting this variable.
|
||||
CustomAppHelpTemplate string
|
||||
// SliceFlagSeparator is used to customize the separator for SliceFlag, the default is ","
|
||||
SliceFlagSeparator string
|
||||
// Boolean to enable short-option handling so user can combine several
|
||||
// single-character bool arguments into one
|
||||
// i.e. foobar -o -v -> foobar -ov
|
||||
@@ -241,6 +243,10 @@ func (a *App) Setup() {
|
||||
if a.Metadata == nil {
|
||||
a.Metadata = make(map[string]interface{})
|
||||
}
|
||||
|
||||
if len(a.SliceFlagSeparator) != 0 {
|
||||
defaultSliceFlagSeparator = a.SliceFlagSeparator
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) newRootCommand() *Command {
|
||||
|
Reference in New Issue
Block a user