moved print_defaults to wwctl genconfig defaults

Signed-off-by: Christian Goll <cgoll@suse.de>
This commit is contained in:
Christian Goll
2023-03-02 15:23:46 +01:00
parent fa78d582eb
commit 1a19cfda63
5 changed files with 40 additions and 25 deletions

View 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
}

View 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
}

View File

@@ -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.