bah alors, et les filtres?
This commit is contained in:
parent
e9ba7987b8
commit
9fe316ad44
@ -1,9 +1,7 @@
|
||||
package applyconfig
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"os"
|
||||
"strings"
|
||||
|
||||
"github.com/spf13/cobra"
|
||||
"novit.nc/direktil/inits/pkg/apply"
|
||||
@ -13,8 +11,8 @@ import (
|
||||
)
|
||||
|
||||
var (
|
||||
filesFilters string
|
||||
log = dlog.Get("dkl")
|
||||
filters []string
|
||||
log = dlog.Get("dkl")
|
||||
)
|
||||
|
||||
func Command() (c *cobra.Command) {
|
||||
@ -26,7 +24,8 @@ func Command() (c *cobra.Command) {
|
||||
Run: run,
|
||||
}
|
||||
|
||||
flag.StringVar(&filesFilters, "files-filters", "", "comma-separated filters to select files to apply")
|
||||
flag := c.Flags()
|
||||
flag.StringArrayVarP(&filters, "filter", "F", []string{}, "glob filter to select files to apply")
|
||||
|
||||
return c
|
||||
}
|
||||
@ -52,10 +51,6 @@ func run(_ *cobra.Command, args []string) {
|
||||
log.Print("failed to load config: ", err)
|
||||
}
|
||||
|
||||
filters := []string{}
|
||||
if filesFilters != "" {
|
||||
filters = strings.Split(filesFilters, ",")
|
||||
}
|
||||
if err = apply.Files(cfg /*log,*/, filters...); err != nil {
|
||||
log.Taint(dlog.Fatal, "failed to apply files: ", err)
|
||||
os.Exit(1)
|
||||
|
Loading…
Reference in New Issue
Block a user