cmd/tailscale: move call to cli.CleanUpArgs() from main() into cli.Run() (#4954)

Not all distributions build from package main.

Signed-off-by: Jordan Whited <jordan@tailscale.com>
This commit is contained in:
Jordan Whited 2022-06-27 14:56:25 -07:00 committed by GitHub
parent 40503ef07a
commit bef6e2831a
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 2 additions and 1 deletions

View File

@ -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"}
}

View File

@ -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"}
}