diff --git a/cli/cmd/root.go b/cli/cmd/root.go new file mode 100644 index 000000000..c0034db66 --- /dev/null +++ b/cli/cmd/root.go @@ -0,0 +1,31 @@ +package cmd + +import ( + "github.com/dropbox/godropbox/errors" + "github.com/pritunl/pritunl-client-electron/cli/errortypes" + "github.com/spf13/cobra" +) + +var RootCmd = &cobra.Command{ + Use: "pritunl-client", + Short: "Pritunl Client Command Line Tool", + Run: func(cmd *cobra.Command, args []string) { + err := cmd.Help() + if err != nil { + err = &errortypes.ExecError{ + errors.Wrap(err, "cmd: Failed to execute help command"), + } + panic(err) + } + }, +} + +func Execute() { + err := RootCmd.Execute() + if err != nil { + err = &errortypes.ExecError{ + errors.Wrap(err, "cmd: Failed to execute root command"), + } + panic(err) + } +}