Lots of changes including: wwctl overlay list and framework for other commands
This commit is contained in:
31
internal/app/wwctl/node/power/root.go
Normal file
31
internal/app/wwctl/node/power/root.go
Normal 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
|
||||
}
|
||||
27
internal/app/wwctl/node/root.go
Normal file
27
internal/app/wwctl/node/root.go
Normal 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
|
||||
}
|
||||
Reference in New Issue
Block a user