This repository has been archived on 2023-08-14. You can view files and clone it, but cannot push or open issues or pull requests.
2016-07-25 20:00:28 +00:00
|
|
|
package main
|
|
|
|
|
|
|
|
import (
|
|
|
|
"fmt"
|
|
|
|
"os"
|
|
|
|
|
|
|
|
"github.com/spf13/cobra"
|
|
|
|
)
|
|
|
|
|
|
|
|
func commandRoot() *cobra.Command {
|
|
|
|
rootCmd := &cobra.Command{
|
2016-08-11 05:31:42 +00:00
|
|
|
Use: "dex",
|
2016-07-25 20:00:28 +00:00
|
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
|
|
cmd.Help()
|
|
|
|
os.Exit(2)
|
|
|
|
},
|
|
|
|
}
|
|
|
|
rootCmd.AddCommand(commandServe())
|
|
|
|
rootCmd.AddCommand(commandVersion())
|
|
|
|
return rootCmd
|
|
|
|
}
|
|
|
|
|
|
|
|
func main() {
|
|
|
|
if err := commandRoot().Execute(); err != nil {
|
|
|
|
fmt.Fprintln(os.Stderr, err.Error())
|
|
|
|
os.Exit(2)
|
|
|
|
}
|
|
|
|
}
|