cmd: factor FlagName into fs.Option #2541
This commit is contained in:
parent
5fde7d8b12
commit
e7e467fb3a
2 changed files with 15 additions and 4 deletions
|
@ -447,10 +447,7 @@ func AddBackendFlags() {
|
|||
}
|
||||
done[opt.Name] = struct{}{}
|
||||
// Make a flag from each option
|
||||
name := strings.Replace(opt.Name, "_", "-", -1) // convert snake_case to kebab-case
|
||||
if !opt.NoPrefix {
|
||||
name = fsInfo.Prefix + "-" + name
|
||||
}
|
||||
name := opt.FlagName(fsInfo.Prefix)
|
||||
found := pflag.CommandLine.Lookup(name) != nil
|
||||
if !found {
|
||||
// Take first line of help only
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue