cmd/tailscale/cli: use errors.Is to check ff's wrapped flag errors
And also check from its Parse method.
@@ -139,13 +139,16 @@ func Run(args []string) error {
}
if err := rootCmd.Parse(args); err != nil {
+ if errors.Is(err, flag.ErrHelp) {
+ return nil
+ }
return err
}
tailscale.TailscaledSocket = rootArgs.socket
err := rootCmd.Run(context.Background())
- if err == flag.ErrHelp {
+ if errors.Is(err, flag.ErrHelp) {
return nil
}
return err
