update durpcli

This commit is contained in:
2023-05-27 11:43:24 -05:00
parent f13224733f
commit ca21cb9811
18 changed files with 193 additions and 157 deletions

18
cmd/cfg/cfg.go Normal file
View File

@@ -0,0 +1,18 @@
package cfg
import (
"github.com/spf13/cobra"
)
var Cfgcmd = &cobra.Command{
Use: "cfg",
Short: "All things Authorization",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
cmd.Help()
},
}
func init() {
}

26
cmd/cfg/newconfig.go Normal file
View File

@@ -0,0 +1,26 @@
package cfg
import (
"fmt"
"github.com/spf13/cobra"
"github.com/spf13/viper"
)
var newcfgcmd = &cobra.Command{
Use: "newconfig",
Short: "Generates a config file using current config",
Long: ``,
Run: func(cmd *cobra.Command, args []string) {
err := viper.WriteConfigAs(".DurpCLI.yaml")
if err != nil {
fmt.Println(err)
}
},
}
func init() {
Cfgcmd.AddCommand(newcfgcmd)
}