diff --git a/cmd/tailscale/cli/cli.go b/cmd/tailscale/cli/cli.go index a73fc71a1..fa76ba33e 100644 --- a/cmd/tailscale/cli/cli.go +++ b/cmd/tailscale/cli/cli.go @@ -129,6 +129,8 @@ func CleanUpArgs(args []string) []string { // Run runs the CLI. The args do not include the binary name. func Run(args []string) (err error) { + args = CleanUpArgs(args) + if len(args) == 1 && (args[0] == "-V" || args[0] == "--version") { args = []string{"version"} } diff --git a/cmd/tailscale/tailscale.go b/cmd/tailscale/tailscale.go index f5b254fe9..c69c86f64 100644 --- a/cmd/tailscale/tailscale.go +++ b/cmd/tailscale/tailscale.go @@ -17,7 +17,6 @@ func main() { args := os.Args[1:] - args = cli.CleanUpArgs(args) if name, _ := os.Executable(); strings.HasSuffix(filepath.Base(name), ".cgi") { args = []string{"web", "-cgi"} }