relax some argument issues to warnings
This commit is contained in:
parent
b021950067
commit
798732dd45
|
|
@ -169,10 +169,10 @@ func main() {
|
|||
args = args[1:]
|
||||
} else {
|
||||
if *data != "" {
|
||||
fail(nil, "The -d argument is not used with 'list' or 'describe' verb.")
|
||||
warn("The -d argument is not used with 'list' or 'describe' verb.")
|
||||
}
|
||||
if len(rpcHeaders) > 0 {
|
||||
fail(nil, "The -rpc-header argument is not used with 'list' or 'describe' verb.")
|
||||
warn("The -rpc-header argument is not used with 'list' or 'describe' verb.")
|
||||
}
|
||||
if len(args) > 0 {
|
||||
symbol = args[0]
|
||||
|
|
@ -190,7 +190,7 @@ func main() {
|
|||
fail(nil, "No host:port specified and no protoset specified.")
|
||||
}
|
||||
if len(protoset) > 0 && len(reflHeaders) > 0 {
|
||||
fail(nil, "The -reflect-header argument is not used when -protoset files are used ")
|
||||
warn("The -reflect-header argument is not used when -protoset files are used ")
|
||||
}
|
||||
|
||||
ctx := context.Background()
|
||||
|
|
@ -419,6 +419,11 @@ the method's request type will be sent.
|
|||
|
||||
}
|
||||
|
||||
func warn(msg string, args ...interface{}) {
|
||||
msg = fmt.Sprintf("Warning: %s\n", msg)
|
||||
fmt.Fprintf(os.Stderr, msg, args...)
|
||||
}
|
||||
|
||||
func fail(err error, msg string, args ...interface{}) {
|
||||
if err != nil {
|
||||
msg += ": %v"
|
||||
|
|
|
|||
Loading…
Reference in New Issue