fix: set config, set remote
This commit is contained in:
19
cmd/config/config.go
Normal file
19
cmd/config/config.go
Normal file
@ -0,0 +1,19 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var configDir string
|
||||
|
||||
var configCmd = &cobra.Command{
|
||||
Use: "config",
|
||||
Short: "config",
|
||||
}
|
||||
|
||||
func InitCmd(cmd *cobra.Command, c string) {
|
||||
configDir = c
|
||||
|
||||
cmd.AddCommand(configCmd)
|
||||
|
||||
}
|
26
cmd/config/create.go
Normal file
26
cmd/config/create.go
Normal file
@ -0,0 +1,26 @@
|
||||
package config
|
||||
|
||||
import (
|
||||
"log"
|
||||
|
||||
"git.cryptic.systems/fh-trier/go-flucky/pkg/config"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
var force bool
|
||||
|
||||
var createConfigCmd = &cobra.Command{
|
||||
Use: "create",
|
||||
Short: "create",
|
||||
Run: func(cmd *cobra.Command, args []string) {
|
||||
|
||||
if err := config.Create(configDir, force); err != nil {
|
||||
log.Fatal(err)
|
||||
}
|
||||
},
|
||||
}
|
||||
|
||||
func init() {
|
||||
configCmd.AddCommand(createConfigCmd)
|
||||
createConfigCmd.Flags().BoolVarP(&force, "force", "f", false, "Force the creation of a new configuration")
|
||||
}
|
Reference in New Issue
Block a user