Update help

Signed-off-by: jcsiadal <jeremy.c.siadal@intel.com>
This commit is contained in:
jcsiadal
2021-11-08 11:36:21 -08:00
parent 3912f5da98
commit 0b93d6c277
57 changed files with 216 additions and 114 deletions

View File

@@ -10,6 +10,7 @@ import (
"github.com/hpcng/warewulf/internal/app/wwctl/profile"
"github.com/hpcng/warewulf/internal/app/wwctl/server"
"github.com/hpcng/warewulf/internal/pkg/wwlog"
"github.com/hpcng/warewulf/internal/pkg/help"
"github.com/spf13/cobra"
"github.com/spf13/cobra/doc"
@@ -18,9 +19,10 @@ import (
var (
rootCmd = &cobra.Command{
Use: "wwctl",
DisableFlagsInUseLine: true,
Use: "wwctl COMMAND [OPTIONS]",
Short: "Warewulf Control",
Long: "Control interface to the Cluster Warewulf Provisioning System.",
Long: "Control interface to the Warewulf Cluster Provisioning System.",
PersistentPreRunE: rootPersistentPreRunE,
SilenceUsage: true,
SilenceErrors: true,
@@ -33,6 +35,9 @@ func init() {
rootCmd.PersistentFlags().BoolVarP(&verboseArg, "verbose", "v", false, "Run with increased verbosity.")
rootCmd.PersistentFlags().BoolVarP(&DebugFlag, "debug", "d", false, "Run with debugging messages enabled.")
rootCmd.SetUsageTemplate(help.UsageTemplate)
rootCmd.SetHelpTemplate(help.HelpTemplate)
rootCmd.AddCommand(overlay.GetCommand())
rootCmd.AddCommand(container.GetCommand())
rootCmd.AddCommand(node.GetCommand())
@@ -60,14 +65,17 @@ func rootPersistentPreRunE(cmd *cobra.Command, args []string) error {
return nil
}
// GenBashCompletionFile
// External functions not used by the wwctl command line
// Generate Bash completion file
func GenBashCompletion(w io.Writer) error {
return rootCmd.GenBashCompletion(w)
}
// Generate man pages
func GenManTree(fileName string) error {
header := &doc.GenManHeader{
Title: "MINE",
Title: "WWCTL",
Section: "1",
}
return doc.GenManTree(rootCmd, header, fileName)