added bash completion for overlay commands
This commit is contained in:
@@ -1,6 +1,7 @@
|
||||
package list
|
||||
|
||||
import (
|
||||
"github.com/hpcng/warewulf/internal/pkg/overlay"
|
||||
"github.com/spf13/cobra"
|
||||
)
|
||||
|
||||
@@ -14,6 +15,13 @@ var (
|
||||
Args: cobra.MinimumNArgs(0),
|
||||
Aliases: []string{"ls"},
|
||||
ValidArgs: []string{"system", "runtime"},
|
||||
ValidArgsFunction: func(cmd *cobra.Command, args []string, toComplete string) ([]string, cobra.ShellCompDirective) {
|
||||
if len(args) != 0 {
|
||||
return nil, cobra.ShellCompDirectiveNoFileComp
|
||||
}
|
||||
list, _ := overlay.FindOverlays()
|
||||
return list, cobra.ShellCompDirectiveNoFileComp
|
||||
},
|
||||
}
|
||||
ListContents bool
|
||||
ListLong bool
|
||||
|
||||
Reference in New Issue
Block a user