update durpcli
This commit is contained in:
26
cmd/cfg/newconfig.go
Normal file
26
cmd/cfg/newconfig.go
Normal 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)
|
||||
}
|
||||
Reference in New Issue
Block a user