mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-03-04 09:18:48 -06:00
Use contMask to ignore categories beginning with . by default
This commit is contained in:
parent
34a209f336
commit
60a3ba71bb
10
cmd/root.go
10
cmd/root.go
@ -47,10 +47,6 @@ from a toml configuration file, and the utility uses this information to
|
||||
execute the necessary podman commands.`,
|
||||
ValidArgsFunction: cobra.NoFileCompletions,
|
||||
PersistentPreRun: func(cmd *cobra.Command, args []string) {
|
||||
if !incDisabled {
|
||||
contMask = []string{"."}
|
||||
}
|
||||
|
||||
requireConn := []string{"create", "pull", "recreate", "restart", "rm", "start", "stop", "update"}
|
||||
if slices.Contains(requireConn, cmd.Name()) {
|
||||
// connect to podman
|
||||
@ -63,6 +59,12 @@ execute the necessary podman commands.`,
|
||||
err := config.Init(conn)
|
||||
if err != nil {
|
||||
fmt.Fprintln(os.Stderr, "Warning: Could not initialize configuration:", err)
|
||||
} else if !incDisabled {
|
||||
for _, c := range config.Categories() {
|
||||
if len(c) > 0 && c[0] == '.' {
|
||||
contMask = append(contMask, c)
|
||||
}
|
||||
}
|
||||
}
|
||||
},
|
||||
}
|
||||
|
Loading…
x
Reference in New Issue
Block a user