Sign Up
Log In
Log In
or
Sign Up
Places
All Projects
Status Monitor
Collapse sidebar
SUSE:SLE-12-SP1:GA
docker-image-migrator
ignore_undefined_flag_errors.patch
Overview
Repositories
Revisions
Requests
Users
Attributes
Meta
File ignore_undefined_flag_errors.patch of Package docker-image-migrator
commit 24d077b02e4f0356607fce1b6e7da72b0a4f26a8 Author: Aleksa Sarai <asarai@suse.de> Date: Mon Mar 14 21:49:56 2016 +1100 pflag: ignore invalid flags In order to ensure that it is possible to use /etc/sysconfig/docker, we have to ignore any undefined flags. Since the migrator doesn't require any positional arguments, this means we can ignore all undefined and left-over arguments. We print warnings so the user is somewhat aware of what's going on. Signed-off-by: Aleksa Sarai <asarai@suse.de> diff --git a/Godeps/_workspace/src/github.com/spf13/pflag/flag.go b/Godeps/_workspace/src/github.com/spf13/pflag/flag.go index deac3af16b4e..1be07b5b54d9 100644 --- a/Godeps/_workspace/src/github.com/spf13/pflag/flag.go +++ b/Godeps/_workspace/src/github.com/spf13/pflag/flag.go @@ -106,6 +106,8 @@ import ( "os" "sort" "strings" + + log "github.com/Sirupsen/logrus" ) // ErrHelp is the error returned if the flag -help is invoked but no such flag is defined. @@ -743,7 +745,10 @@ func (f *FlagSet) parseLongArg(s string, args []string) (a []string, err error) f.usage() return a, ErrHelp } - err = f.failf("unknown flag: --%s", name) + // Don't set an error here, just output a warning. + log.WithFields(log.Fields{ + "flag": name, + }).Warn("ignoring unknown long flag") return } var value string @@ -778,8 +783,11 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string) (outShor err = ErrHelp return } - //TODO continue on error - err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) + // Don't set an error here, just output a warning. + log.WithFields(log.Fields{ + "flag": string(c), + "argv": shorthands, + }).Warn("ignoring unknown shorthand flag") return } var value string
Locations
Projects
Search
Status Monitor
Help
OpenBuildService.org
Documentation
API Documentation
Code of Conduct
Contact
Support
@OBShq
Terms
openSUSE Build Service is sponsored by
The Open Build Service is an
openSUSE project
.
Sign Up
Log In
Places
Places
All Projects
Status Monitor