Skip to content

Commit d2b4cc7

Browse files
committed
govc: Add '-id' option for tags.category and tags create commands
Signed-off-by: Doug MacEachern <[email protected]>
1 parent c99e28c commit d2b4cc7

File tree

3 files changed

+10
-30
lines changed

3 files changed

+10
-30
lines changed

cli/tags/category/create.go

100755100644
Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
/*
2-
Copyright (c) 2018 VMware, Inc. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// © Broadcom. All Rights Reserved.
2+
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
3+
// SPDX-License-Identifier: Apache-2.0
164

175
package category
186

@@ -39,6 +27,7 @@ func init() {
3927
func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) {
4028
cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
4129
cmd.ClientFlag.Register(ctx, f)
30+
f.StringVar(&cmd.cat.CategoryID, "id", "", "Category ID")
4231
f.StringVar(&cmd.cat.Description, "d", "", "Description")
4332
f.Var((*kinds)(&cmd.cat.AssociableTypes), "t", "Object types")
4433
f.BoolVar(&cmd.multi, "m", false, "Allow multiple tags per object")

cli/tags/create.go

Lines changed: 4 additions & 15 deletions
Original file line numberDiff line numberDiff line change
@@ -1,18 +1,6 @@
1-
/*
2-
Copyright (c) 2018 VMware, Inc. All Rights Reserved.
3-
4-
Licensed under the Apache License, Version 2.0 (the "License");
5-
you may not use this file except in compliance with the License.
6-
You may obtain a copy of the License at
7-
8-
http://www.apache.org/licenses/LICENSE-2.0
9-
10-
Unless required by applicable law or agreed to in writing, software
11-
distributed under the License is distributed on an "AS IS" BASIS,
12-
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
13-
See the License for the specific language governing permissions and
14-
limitations under the License.
15-
*/
1+
// © Broadcom. All Rights Reserved.
2+
// The term “Broadcom” refers to Broadcom Inc. and/or its subsidiaries.
3+
// SPDX-License-Identifier: Apache-2.0
164

175
package tags
186

@@ -38,6 +26,7 @@ func init() {
3826
func (cmd *create) Register(ctx context.Context, f *flag.FlagSet) {
3927
cmd.ClientFlag, ctx = flags.NewClientFlag(ctx)
4028
cmd.ClientFlag.Register(ctx, f)
29+
f.StringVar(&cmd.tag.TagID, "id", "", "Tag ID")
4130
f.StringVar(&cmd.tag.CategoryID, "c", "", "Category name")
4231
f.StringVar(&cmd.tag.Description, "d", "", "Description of tag")
4332
}

govc/USAGE.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -6117,6 +6117,7 @@ Examples:
61176117
61186118
Options:
61196119
-d= Description
6120+
-id= Category ID
61206121
-m=false Allow multiple tags per object
61216122
-t=[] Object types
61226123
```
@@ -6205,6 +6206,7 @@ Examples:
62056206
Options:
62066207
-c= Category name
62076208
-d= Description of tag
6209+
-id= Tag ID
62086210
```
62096211

62106212
## tags.detach

0 commit comments

Comments
 (0)