Files
warewulf/internal/app/wwctl/overlay/build/root.go
2022-03-11 15:03:15 +01:00

29 lines
847 B
Go

package build
import "github.com/spf13/cobra"
var (
baseCmd = &cobra.Command{
DisableFlagsInUseLine: true,
Use: "build [OPTIONS] NODENAME...",
Short: "(Re)build node overlays",
Long: "This command builds overlays for given nodes.",
RunE: CobraRunE,
}
BuildHost bool
BuildNodes bool
OverlayName string
)
func init() {
baseCmd.PersistentFlags().BoolVarP(&BuildHost, "host", "H", false, "Build overlays only for the host")
baseCmd.PersistentFlags().BoolVarP(&BuildNodes, "nodes", "N", false, "Build overlays only for the nodes")
baseCmd.PersistentFlags().StringVarP(&OverlayName, "overlay", "o", "", "Build only specific overlay")
}
// GetRootCommand returns the root cobra.Command for the application.
func GetCommand() *cobra.Command {
return baseCmd
}