mirror of
https://gitlab.durp.info/durfy/apps/durpcli.git
synced 2026-05-07 07:50:35 -05:00
update durpcli
This commit is contained in:
parent
f13224733f
commit
ca21cb9811
18 changed files with 193 additions and 157 deletions
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)
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue