Use wwctl overlay <import|build> --workers=0 to indicate default value

By default, uses `runtime.NumCPU()`

The default value is rendered in the generated man pages, which made
their content dependent on build system characteristics.

Signed-off-by: Jonathon Anderson <janderson@ciq.com>
This commit is contained in:
Christian Goll
2025-02-26 17:07:31 +01:00
parent f4b65fca90
commit a97c204f53
5 changed files with 20 additions and 9 deletions

View File

@@ -1,8 +1,6 @@
package build
import (
"runtime"
"github.com/spf13/cobra"
"github.com/warewulf/warewulf/internal/app/wwctl/completions"
)
@@ -29,7 +27,7 @@ func init() {
}
baseCmd.PersistentFlags().StringVarP(&OverlayDir, "output", "o", "", `Do not create an overlay image for distribution but write to
the given directory. An overlay must also be ge given to use this option.`)
baseCmd.PersistentFlags().IntVar(&Workers, "workers", runtime.NumCPU(), "The number of parallel workers building overlays")
baseCmd.PersistentFlags().IntVar(&Workers, "workers", 0, "The number of parallel workers building overlays (<=0 indicates 1 worker per CPU)")
}
// GetRootCommand returns the root cobra.Command for the application.