mirror of
https://github.com/tailscale/tailscale.git
synced 2024-11-29 13:05:46 +00:00
cmd/tailscale/cli: use errors.Is to check ff's wrapped flag errors
And also check from its Parse method. Change-Id: I18754920575254cb6858a16b7954e74aa16483a1 Signed-off-by: Brad Fitzpatrick <bradfitz@tailscale.com>
This commit is contained in:
parent
75de4e9cc2
commit
3b5ada1fd8
@ -139,13 +139,16 @@ func Run(args []string) error {
|
|||||||
}
|
}
|
||||||
|
|
||||||
if err := rootCmd.Parse(args); err != nil {
|
if err := rootCmd.Parse(args); err != nil {
|
||||||
|
if errors.Is(err, flag.ErrHelp) {
|
||||||
|
return nil
|
||||||
|
}
|
||||||
return err
|
return err
|
||||||
}
|
}
|
||||||
|
|
||||||
tailscale.TailscaledSocket = rootArgs.socket
|
tailscale.TailscaledSocket = rootArgs.socket
|
||||||
|
|
||||||
err := rootCmd.Run(context.Background())
|
err := rootCmd.Run(context.Background())
|
||||||
if err == flag.ErrHelp {
|
if errors.Is(err, flag.ErrHelp) {
|
||||||
return nil
|
return nil
|
||||||
}
|
}
|
||||||
return err
|
return err
|
||||||
|
Loading…
Reference in New Issue
Block a user