41 lines
1.3 KiB
Go
41 lines
1.3 KiB
Go
// Copyright Matthew Stobbs <matthew@stobbs.ca>
|
|
//
|
|
// Package cmd contains the main application file for ClustVirt.
|
|
// This command is used for everything, implementing the command pattern
|
|
// with the help of spf13/cobra.
|
|
// After building, the executable's first argument must be one of the valid
|
|
// commands, such as `daemon`, `api`, `query`, `host`, etc. This pattern allows
|
|
// for a simple way to access functionality, reducing the need to use the
|
|
// REST api directly.
|
|
package cmd
|
|
|
|
import (
|
|
"fmt"
|
|
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
// configCmd represents the config command
|
|
var configCmd = &cobra.Command{
|
|
Use: "config",
|
|
Short: "Configure the clustvirt daemon",
|
|
Long: `Allows for editing the clustvirt daemon configuration using command line flags`,
|
|
Run: func(cmd *cobra.Command, args []string) {
|
|
fmt.Println("config called")
|
|
},
|
|
}
|
|
|
|
func init() {
|
|
rootCmd.AddCommand(configCmd)
|
|
|
|
// Here you will define your flags and configuration settings.
|
|
|
|
// Cobra supports Persistent Flags which will work for this command
|
|
// and all subcommands, e.g.:
|
|
// configCmd.PersistentFlags().String("foo", "", "A help for foo")
|
|
|
|
// Cobra supports local flags which will only run when this command
|
|
// is called directly, e.g.:
|
|
// configCmd.Flags().BoolP("toggle", "t", false, "Help message for toggle")
|
|
}
|