diff --git a/cmd/tailscale/cli/bugreport.go b/cmd/tailscaled/cli/bugreport.go similarity index 100% rename from cmd/tailscale/cli/bugreport.go rename to cmd/tailscaled/cli/bugreport.go diff --git a/cmd/tailscale/cli/cli.go b/cmd/tailscaled/cli/cli.go similarity index 100% rename from cmd/tailscale/cli/cli.go rename to cmd/tailscaled/cli/cli.go diff --git a/cmd/tailscale/cli/cli_test.go b/cmd/tailscaled/cli/cli_test.go similarity index 100% rename from cmd/tailscale/cli/cli_test.go rename to cmd/tailscaled/cli/cli_test.go diff --git a/cmd/tailscale/cli/debug.go b/cmd/tailscaled/cli/debug.go similarity index 100% rename from cmd/tailscale/cli/debug.go rename to cmd/tailscaled/cli/debug.go diff --git a/cmd/tailscale/cli/down.go b/cmd/tailscaled/cli/down.go similarity index 100% rename from cmd/tailscale/cli/down.go rename to cmd/tailscaled/cli/down.go diff --git a/cmd/tailscale/cli/file.go b/cmd/tailscaled/cli/file.go similarity index 100% rename from cmd/tailscale/cli/file.go rename to cmd/tailscaled/cli/file.go diff --git a/cmd/tailscale/cli/ip.go b/cmd/tailscaled/cli/ip.go similarity index 100% rename from cmd/tailscale/cli/ip.go rename to cmd/tailscaled/cli/ip.go diff --git a/cmd/tailscale/cli/logout.go b/cmd/tailscaled/cli/logout.go similarity index 100% rename from cmd/tailscale/cli/logout.go rename to cmd/tailscaled/cli/logout.go diff --git a/cmd/tailscale/cli/netcheck.go b/cmd/tailscaled/cli/netcheck.go similarity index 100% rename from cmd/tailscale/cli/netcheck.go rename to cmd/tailscaled/cli/netcheck.go diff --git a/cmd/tailscale/cli/ping.go b/cmd/tailscaled/cli/ping.go similarity index 100% rename from cmd/tailscale/cli/ping.go rename to cmd/tailscaled/cli/ping.go diff --git a/cmd/tailscale/cli/status.go b/cmd/tailscaled/cli/status.go similarity index 100% rename from cmd/tailscale/cli/status.go rename to cmd/tailscaled/cli/status.go diff --git a/cmd/tailscale/cli/up.go b/cmd/tailscaled/cli/up.go similarity index 100% rename from cmd/tailscale/cli/up.go rename to cmd/tailscaled/cli/up.go diff --git a/cmd/tailscale/cli/version.go b/cmd/tailscaled/cli/version.go similarity index 100% rename from cmd/tailscale/cli/version.go rename to cmd/tailscaled/cli/version.go diff --git a/cmd/tailscale/cli/web.css b/cmd/tailscaled/cli/web.css similarity index 100% rename from cmd/tailscale/cli/web.css rename to cmd/tailscaled/cli/web.css diff --git a/cmd/tailscale/cli/web.go b/cmd/tailscaled/cli/web.go similarity index 100% rename from cmd/tailscale/cli/web.go rename to cmd/tailscaled/cli/web.go diff --git a/cmd/tailscale/cli/web.html b/cmd/tailscaled/cli/web.html similarity index 100% rename from cmd/tailscale/cli/web.html rename to cmd/tailscaled/cli/web.html diff --git a/cmd/tailscaled/main.go b/cmd/tailscaled/main.go new file mode 100644 index 000000000..5b37f08dc --- /dev/null +++ b/cmd/tailscaled/main.go @@ -0,0 +1,16 @@ +package main + +import ( + "os" + "strings" +) + +func main() { + if strings.HasSuffix(os.Args[0], "tailscaled") { + tailscaled_main() + } else if strings.HasSuffix(os.Args[0], "tailscale") { + tailscale_main() + } else { + panic(os.Args[0]) + } +} diff --git a/cmd/tailscale/tailscale.go b/cmd/tailscaled/tailscale.go similarity index 83% rename from cmd/tailscale/tailscale.go rename to cmd/tailscaled/tailscale.go index c69c86f64..94a3563a0 100644 --- a/cmd/tailscale/tailscale.go +++ b/cmd/tailscaled/tailscale.go @@ -4,7 +4,7 @@ // The tailscale command is the Tailscale command-line client. It interacts // with the tailscaled node agent. -package main // import "tailscale.com/cmd/tailscale" +package main // import "tailscale.com/cmd/tailscaled" import ( "fmt" @@ -12,10 +12,10 @@ "path/filepath" "strings" - "tailscale.com/cmd/tailscale/cli" + "tailscale.com/cmd/tailscaled/cli" ) -func main() { +func tailscale_main() { args := os.Args[1:] if name, _ := os.Executable(); strings.HasSuffix(filepath.Base(name), ".cgi") { args = []string{"web", "-cgi"} diff --git a/cmd/tailscaled/tailscaled.go b/cmd/tailscaled/tailscaled.go index 63296204d..1adf9a01e 100644 --- a/cmd/tailscaled/tailscaled.go +++ b/cmd/tailscaled/tailscaled.go @@ -101,7 +101,7 @@ func defaultTunName() string { "debug": &debugModeFunc, } -func main() { +func tailscaled_main() { // We aren't very performance sensitive, and the parts that are // performance sensitive (wireguard) try hard not to do any memory // allocations. So let's be aggressive about garbage collection,