added binary to create bash completion
also do not bail out, when configs can't be read, still the
This commit is contained in:
23
cmd/bash_completion/bash_completion.go
Normal file
23
cmd/bash_completion/bash_completion.go
Normal 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
|
||||
}
|
||||
}
|
||||
@@ -9,3 +9,4 @@ func main() {
|
||||
|
||||
root.Execute()
|
||||
}
|
||||
|
||||
|
||||
Reference in New Issue
Block a user