From 3a07360b6ec6cbe3ffc0e3596a22cdc3f1ab62b4 Mon Sep 17 00:00:00 2001 From: ohdearaugustin Date: Sun, 25 Jul 2021 15:10:34 +0200 Subject: [PATCH] Add root cmd --- cmd/headscale/cli/root.go | 28 ++++++++++++++++++++++++++++ 1 file changed, 28 insertions(+) create mode 100644 cmd/headscale/cli/root.go diff --git a/cmd/headscale/cli/root.go b/cmd/headscale/cli/root.go new file mode 100644 index 00000000..0dd68064 --- /dev/null +++ b/cmd/headscale/cli/root.go @@ -0,0 +1,28 @@ +package cli + +import ( + "fmt" + "github.com/spf13/cobra" + "os" +) + +func init() { + rootCmd.PersistentFlags().StringP("output", "o", "", "Output format. Empty for human-readable, 'json' or 'json-line'") +} + +var rootCmd = &cobra.Command{ + Use: "headscale", + Short: "headscale - a Tailscale control server", + Long: ` +headscale is an open source implementation of the Tailscale control server + +Juan Font Alonso - 2021 +https://gitlab.com/juanfont/headscale`, +} + +func Execute() { + if err := rootCmd.Execute(); err != nil { + fmt.Fprintln(os.Stderr, err) + os.Exit(1) + } +}