31 lines
789 B
Go
31 lines
789 B
Go
package list
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
)
|
|
|
|
var (
|
|
baseCmd = &cobra.Command{
|
|
Use: "list",
|
|
Short: "List Warewulf Overlays",
|
|
Long: "Warewulf List overlay",
|
|
RunE: CobraRunE,
|
|
Aliases: []string{"ls"},
|
|
}
|
|
SystemOverlay bool
|
|
ListContents bool
|
|
ListLong bool
|
|
)
|
|
|
|
func init() {
|
|
baseCmd.PersistentFlags().BoolVarP(&SystemOverlay, "system", "s", false, "Show system overlays instead of runtime")
|
|
baseCmd.PersistentFlags().BoolVarP(&ListContents, "all", "a", false, "List the contents of overlays")
|
|
baseCmd.PersistentFlags().BoolVarP(&ListLong, "long", "l", false, "List 'long' of all overlay contents")
|
|
|
|
}
|
|
|
|
// GetRootCommand returns the root cobra.Command for the application.
|
|
func GetCommand() *cobra.Command {
|
|
return baseCmd
|
|
}
|