opt-multi: changed the help template
This commit is contained in:
parent
4111864916
commit
f55e9cea82
14
opt-multi.go
14
opt-multi.go
@ -1,6 +1,9 @@
|
||||
package cli
|
||||
|
||||
import "strconv"
|
||||
import (
|
||||
"fmt"
|
||||
"strconv"
|
||||
)
|
||||
|
||||
const (
|
||||
multiTypeName = "num"
|
||||
@ -34,8 +37,13 @@ func (opt *cliOptionMulti) getDefaultValue() string {
|
||||
return strconv.Itoa(opt.defaultValue)
|
||||
}
|
||||
|
||||
func (opt *cliOptionMulti) getTemplate() string {
|
||||
return opt.makeOptTemplate(false, multiTypeName)
|
||||
func (opt *cliOptionMulti) getTemplate() (templ string) {
|
||||
if opt.shortAlias != "" {
|
||||
templ = fmt.Sprintf(`-%s, --%s`, opt.shortAlias, opt.name)
|
||||
} else {
|
||||
templ = fmt.Sprintf(`--%s`, opt.name)
|
||||
}
|
||||
return
|
||||
}
|
||||
|
||||
func (opt *cliOptionMulti) parse(parser cliParser, argIndex int, valuePtr *string) (skipNextArg bool, err error) {
|
||||
|
||||
Loading…
Reference in New Issue
Block a user