Skip to content

Commit

Permalink
Add cmd root
Browse files Browse the repository at this point in the history
  • Loading branch information
zachhuff386 committed Aug 8, 2020
1 parent a02bbb9 commit 0f9c513
Showing 1 changed file with 31 additions and 0 deletions.
31 changes: 31 additions & 0 deletions cli/cmd/root.go
Original file line number Diff line number Diff line change
@@ -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)
}
}

0 comments on commit 0f9c513

Please sign in to comment.