moved print_defaults to wwctl genconfig defaults
Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
13
internal/app/wwctl/genconf/dfaults/main.go
Normal file
13
internal/app/wwctl/genconf/dfaults/main.go
Normal file
@@ -0,0 +1,13 @@
|
||||
package dfaults
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
|
||||
"github.com/hpcng/warewulf/internal/pkg/node"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
func CobraRunE(cmd *cobra.Command, args []string) (err error) {
|
||||
fmt.Println(node.FallBackConf)
|
||||
return
|
||||
}
|
||||
22
internal/app/wwctl/genconf/dfaults/root.go
Normal file
22
internal/app/wwctl/genconf/dfaults/root.go
Normal file
@@ -0,0 +1,22 @@
|
||||
package dfaults
|
||||
|
||||
import "github.com/spf13/cobra"
|
||||
|
||||
var (
|
||||
baseCmd = &cobra.Command{
|
||||
Use: "defaults",
|
||||
Short: "print defaults",
|
||||
Long: "This command prints the fallbacks which are used if defaults.conf isn't present",
|
||||
RunE: CobraRunE,
|
||||
Args: cobra.NoArgs,
|
||||
Aliases: []string{"dfaults"},
|
||||
}
|
||||
Zsh bool
|
||||
)
|
||||
|
||||
func init() {
|
||||
}
|
||||
|
||||
func GetCommand() *cobra.Command {
|
||||
return baseCmd
|
||||
}
|
||||
@@ -2,6 +2,7 @@ package genconf
|
||||
|
||||
import (
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/completions"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/dfaults"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/man"
|
||||
"github.com/hpcng/warewulf/internal/app/wwctl/genconf/reference"
|
||||
"github.com/spf13/cobra"
|
||||
@@ -23,6 +24,7 @@ func init() {
|
||||
baseCmd.AddCommand(completions.GetCommand())
|
||||
baseCmd.AddCommand(man.GetCommand())
|
||||
baseCmd.AddCommand(reference.GetCommand())
|
||||
baseCmd.AddCommand(dfaults.GetCommand())
|
||||
}
|
||||
|
||||
// GetRootCommand returns the root cobra.Command for the application.
|
||||
|
||||
Reference in New Issue
Block a user