added binary to create bash completion

also do not bail out, when configs can't be read, still the
This commit is contained in:
Christian Goll
2021-07-16 14:32:39 +02:00
parent 75c0e66f30
commit b27951b59f
6 changed files with 42 additions and 4 deletions

View File

@@ -0,0 +1,23 @@
// usage: ./bash_completion <FILE>
package main
import (
"fmt"
"os"
"github.com/hpcng/warewulf/internal/app/wwctl"
)
func main() {
fh, err := os.Create(os.Args[1])
if err != nil {
fmt.Println(err)
return
}
defer fh.Close()
if err := wwctl.GenBashCompletion(fh); err != nil {
fmt.Println(err)
return
}
}