diff --git a/cat/cat.go b/cat/cat.go index 78330e8..5a72933 100644 --- a/cat/cat.go +++ b/cat/cat.go @@ -39,11 +39,13 @@ func Run(args []string) int { args = args[1:] flagSet := flag.NewFlagSet(arg0, flag.ExitOnError) flagSet.Parse(args) + args = flagSet.Args() if len(args)>0 { for _, p := range args { e := cat(p) if e != nil { fmt.Fprintf(os.Stderr, "%s: %s.\n", arg0, e) + status = 1 } } } else { diff --git a/tac/tac.go b/tac/tac.go index d6efda1..d3f9012 100644 --- a/tac/tac.go +++ b/tac/tac.go @@ -53,11 +53,13 @@ func Run(args []string) int { args = args[1:] flagSet := flag.NewFlagSet(arg0, flag.ExitOnError) flagSet.Parse(args) + args = flagSet.Args() if len(args)>0 { for _, p := range args { e := tac(p) if e != nil { fmt.Fprintf(os.Stderr, "%s: %s.\n", arg0, e) + status = 1 } } } else {