cmd: split flags up into global and backend flags #2541
This commit is contained in:
parent
3c086f5f7f
commit
5fde7d8b12
2 changed files with 17 additions and 1 deletions
|
@ -432,8 +432,11 @@ func resolveExitCode(err error) {
|
|||
}
|
||||
}
|
||||
|
||||
var backendFlags map[string]struct{}
|
||||
|
||||
// AddBackendFlags creates flags for all the backend options
|
||||
func AddBackendFlags() {
|
||||
backendFlags = map[string]struct{}{}
|
||||
for _, fsInfo := range fs.Registry {
|
||||
done := map[string]struct{}{}
|
||||
for i := range fsInfo.Options {
|
||||
|
@ -464,6 +467,7 @@ func AddBackendFlags() {
|
|||
if opt.Hide&fs.OptionHideCommandLine != 0 {
|
||||
flag.Hidden = true
|
||||
}
|
||||
backendFlags[name] = struct{}{}
|
||||
} else {
|
||||
fs.Errorf(nil, "Not adding duplicate flag --%s", name)
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue