We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
1 parent ef4678f commit ee25370Copy full SHA for ee25370
subcommands/targets/tag.go
@@ -20,7 +20,7 @@ var (
20
)
21
22
func init() {
23
- var tagCmd = &cobra.Command{
+ tagCmd := &cobra.Command{
24
Use: "tag <target> [<target>...]",
25
Short: "Apply a comma separated list of tags to one or more Targets.",
26
Example: `
@@ -57,6 +57,9 @@ func Set(a, b []string) []string {
57
func doTag(cmd *cobra.Command, args []string) {
58
factory := viper.GetString("factory")
59
tags := strings.Split(tagTags, ",")
60
+ if !tagAppend && len(tags) == 0 {
61
+ subcommands.DieNotNil(fmt.Errorf("Tags list cannot be empty when setting tags"))
62
+ }
63
64
// Make sure all tags are unique, no accidental repeats/typos
65
if len(tags) != len(Set(tags, nil)) {
0 commit comments