Lots of changes including: wwctl overlay list and framework for other commands

This commit is contained in:
Gregory Kurtzer
2020-11-16 21:37:55 -08:00
parent 52eb51e38a
commit 85603ee947
19 changed files with 484 additions and 34 deletions

View File

@@ -0,0 +1,31 @@
package power
import (
"fmt"
"github.com/spf13/cobra"
)
var (
baseCmd = &cobra.Command{
Use: "power",
Short: "Node power management",
Long: "Node Power management commands",
RunE: CobraRunE,
}
test bool
)
func init() {
baseCmd.PersistentFlags().BoolVarP(&test, "test", "t", false, "Testing.")
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}
func CobraRunE(cmd *cobra.Command, args []string) error {
fmt.Printf("Power: Hello World\n")
return nil
}

View File

@@ -0,0 +1,27 @@
package node
import (
"github.com/hpcng/warewulf/internal/app/wwctl/node/power"
"github.com/spf13/cobra"
)
var (
baseCmd = &cobra.Command{
Use: "node",
Short: "Node management",
Long: "Management of node settings and power management",
}
test bool
)
func init() {
baseCmd.PersistentFlags().BoolVarP(&test, "test", "t", false, "Testing.")
baseCmd.AddCommand(power.GetCommand())
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}