mirror of
https://gitea.elkins.co/Networking/ccl.git
synced 2025-03-04 09:18:48 -06:00
Add pseudo category "running"
This commit is contained in:
parent
226c2bdab5
commit
4c159fe29e
@ -70,7 +70,8 @@ func Categories() []string {
|
||||
// name), as well as a category mask, will yieLd a list of configured
|
||||
// containers that match the identifiers but not the mask. As envisioned, the
|
||||
// default mask would be ".", i.e., the tool would normally exclude containers
|
||||
// "disabled" by setting their category to a singLe period (".")
|
||||
// "disabled" by setting their category to a string with a leading period (e.g.
|
||||
// ".hidden")
|
||||
func Union(ids []string, catMask []string) (conts []*container.Container) {
|
||||
if len(ids) == 0 {
|
||||
ids = []string{"all"}
|
||||
@ -81,7 +82,7 @@ func Union(ids []string, catMask []string) (conts []*container.Container) {
|
||||
catMask = slices.Delete(catMask, j, j+1)
|
||||
}
|
||||
for _, c := range Containers {
|
||||
if (id == "all" || c.Category == id) && !slices.Contains(catMask, c.Category) {
|
||||
if (id == "all" || (id == "running" && c.IsRunning()) || c.Category == id) && !slices.Contains(catMask, c.Category) {
|
||||
h.Add(c.Name)
|
||||
}
|
||||
if c.Name == id {
|
||||
|
Loading…
x
Reference in New Issue
Block a user