36 lines
989 B
Go
36 lines
989 B
Go
package show
|
|
|
|
import (
|
|
"github.com/spf13/cobra"
|
|
"github.com/warewulf/warewulf/internal/app/wwctl/completions"
|
|
)
|
|
|
|
var (
|
|
baseCmd = &cobra.Command{
|
|
DisableFlagsInUseLine: true,
|
|
Use: "show [OPTIONS] IMAGE",
|
|
Short: "Show root fs dir for image",
|
|
Long: `Shows the base directory for the chroot of the given image.
|
|
More information about the image can be shown with the '-a' option.`,
|
|
RunE: CobraRunE,
|
|
Args: cobra.ExactArgs(1),
|
|
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
|
if len(args) == 0 {
|
|
return completions.Images(cmd, args, toComplete)
|
|
}
|
|
return completions.None(cmd, args, toComplete)
|
|
},
|
|
}
|
|
ShowAll bool
|
|
)
|
|
|
|
func init() {
|
|
baseCmd.PersistentFlags().BoolVarP(&ShowAll, "all", "a", false, "Show all information about an image")
|
|
|
|
}
|
|
|
|
// GetRootCommand returns the root cobra.Command for the application.
|
|
func GetCommand() *cobra.Command {
|
|
return baseCmd
|
|
}
|