Skip to content

Commit

Permalink
Merge pull request #1444 from rsteube/docker-tags
Browse files Browse the repository at this point in the history
docker: added tags
  • Loading branch information
rsteube authored Dec 14, 2022
2 parents 3081d80 + 037fb7e commit 35adbd6
Show file tree
Hide file tree
Showing 2 changed files with 14 additions and 14 deletions.
26 changes: 13 additions & 13 deletions pkg/actions/tools/docker/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ func ActionConfigs() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
})
})
}).Tag("configs")
}

// ActionContainers completes container names
Expand All @@ -34,7 +34,7 @@ func ActionContainers() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...).Style(styles.Docker.Container)
})
})
}).Tag("containers")
}

// ActionContainerIds completes container names
Expand All @@ -47,7 +47,7 @@ func ActionContainerIds() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
})
})
}).Tag("container ids")
}

// ActionRepositories completes repository names
Expand All @@ -60,7 +60,7 @@ func ActionRepositories() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValues(vals[:len(vals)-1]...)
})
})
}).Tag("repositories")
}

// ActionRepositoryTags completes repository names and tags separately
Expand All @@ -80,7 +80,7 @@ func ActionRepositoryTags() carapace.Action {
reposWithSuffix[index] = strings.SplitAfter(val, ":")[0]
}
}
return carapace.ActionValues(reposWithSuffix...)
return carapace.ActionValues(reposWithSuffix...).Tag("repositories")
case 1:
tags := make([]string, 0)
for _, val := range lines[:len(lines)-1] {
Expand All @@ -89,7 +89,7 @@ func ActionRepositoryTags() carapace.Action {
tags = append(tags, tag)
}
}
return carapace.ActionValues(tags...)
return carapace.ActionValues(tags...).Tag("tags")
default:
return carapace.ActionValues()
}
Expand Down Expand Up @@ -184,7 +184,7 @@ func ActionNetworks() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...).Style(styles.Docker.Network)
})
})
}).Tag("networks")
}

// ActionNodes completes node ids
Expand All @@ -197,7 +197,7 @@ func ActionNodes() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...).Style(styles.Docker.Node)
})
})
}).Tag("nodes")
}

// ActionPlugins completes plugins
Expand All @@ -209,7 +209,7 @@ func ActionPlugins() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
})
})
}).Tag("plugins")
}

// ActionSecrets completes secrets
Expand All @@ -222,7 +222,7 @@ func ActionSecrets() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
}).Style(styles.Docker.Secret)
})
}).Tag("secrets")
}

// ActionServices completes services
Expand All @@ -235,7 +235,7 @@ func ActionServices() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
}).Style(styles.Docker.Service)
})
}).Tag("services")
}

// ActionVolumes completes volume names
Expand All @@ -248,7 +248,7 @@ func ActionVolumes() carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
}).Style(styles.Docker.Volume)
})
}).Tag("volumes")
}

// ActionStacks completes stacks
Expand All @@ -264,5 +264,5 @@ func ActionStacks(orchestrator string) carapace.Action {
vals := strings.Split(string(output), "\n")
return carapace.ActionValuesDescribed(vals[:len(vals)-1]...)
})
})
}).Tag("stacks")
}
2 changes: 1 addition & 1 deletion pkg/styles/docker.go
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ var Docker = struct {
}{
Container: style.Blue,
Image: style.Yellow,
Network: style.Gray,
Network: style.Magenta,
Node: style.Cyan,
Secret: style.Underlined,
Service: style.Green,
Expand Down

0 comments on commit 35adbd6

Please sign in to comment.