20 lines
314 B
Go
20 lines
314 B
Go
|
package cmd
|
||
|
|
||
|
import (
|
||
|
"io"
|
||
|
"text/template"
|
||
|
|
||
|
"go.fifitido.net/cmd/opt"
|
||
|
)
|
||
|
|
||
|
func WriteBashCompletions(out io.Writer, rootCmd *Command) error {
|
||
|
return bashTpl.Execute(out, map[string]any{
|
||
|
"rootCmd": rootCmd,
|
||
|
"globalOpts": opt.Globals(),
|
||
|
})
|
||
|
}
|
||
|
|
||
|
var bashTpl = template.Must(template.New("bash").Parse(`
|
||
|
|
||
|
`))
|