Skip to content

Commit

Permalink
print warnings to Stderr when unexpected args are specified
Browse files Browse the repository at this point in the history
  • Loading branch information
astj committed Jun 15, 2017
1 parent e478740 commit 7e9f974
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion check-log/lib/check-log.go
Original file line number Diff line number Diff line change
Expand Up @@ -133,7 +133,10 @@ func parseArgs(args []string) (*logOpts, error) {
origArgs := make([]string, len(args))
copy(origArgs, args)
opts := &logOpts{}
_, err := flags.ParseArgs(opts, args)
remains, err := flags.ParseArgs(opts, args)
if err == nil && len(remains) != 0 {
fmt.Fprintln(os.Stderr, "[Warning] unexpected arguments. they will be ignored: ", remains)
}
opts.origArgs = origArgs
if opts.StateDir == "" {
workdir := pluginutil.PluginWorkDir()
Expand Down

0 comments on commit 7e9f974

Please sign in to comment.