-
Notifications
You must be signed in to change notification settings - Fork 13
/
zz_read_gen.go
125 lines (112 loc) · 3.97 KB
/
zz_read_gen.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
// Copyright 2017-2023 The sacloud/usacloud Authors
//
// Licensed under the Apache License, Version 2.0 (the "License");
// you may not use this file except in compliance with the License.
// You may obtain a copy of the License at
//
// http://www.apache.org/licenses/LICENSE-2.0
//
// Unless required by applicable law or agreed to in writing, software
// distributed under the License is distributed on an "AS IS" BASIS,
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
// See the License for the specific language governing permissions and
// limitations under the License.
// Code generated by 'github.com/sacloud/usacloud/tools/gen-commands'; DO NOT EDIT
package ipv6addr
import (
"github.com/sacloud/usacloud/pkg/core"
"github.com/spf13/cobra"
"github.com/spf13/pflag"
)
func (p *readParameter) CleanupEmptyValue(fs *pflag.FlagSet) {
}
func (p *readParameter) buildFlags(fs *pflag.FlagSet) {
fs.StringVarP(&p.Zone, "zone", "", p.Zone, "(*required) ")
fs.StringVarP(&p.Parameters, "parameters", "", p.Parameters, "Input parameters in JSON format")
fs.BoolVarP(&p.GenerateSkeleton, "generate-skeleton", "", p.GenerateSkeleton, "Output skeleton of parameters with JSON format (aliases: --skeleton)")
fs.BoolVarP(&p.Example, "example", "", p.Example, "Output example parameters with JSON format")
fs.StringVarP(&p.OutputType, "output-type", "o", p.OutputType, "Output format options: [table/json/yaml] (aliases: --out)")
fs.BoolVarP(&p.Quiet, "quiet", "q", p.Quiet, "Output IDs only")
fs.StringVarP(&p.Format, "format", "", p.Format, "Output format in Go templates (aliases: --fmt)")
fs.StringVarP(&p.Query, "query", "", p.Query, "Query for JSON output")
fs.StringVarP(&p.QueryDriver, "query-driver", "", p.QueryDriver, "Name of the driver that handles queries to JSON output options: [jmespath/jq]")
fs.StringVarP(&p.IPv6Addr, "i-pv6-addr", "", p.IPv6Addr, "(*required) ")
fs.SetNormalizeFunc(p.normalizeFlagName)
}
func (p *readParameter) normalizeFlagName(_ *pflag.FlagSet, name string) pflag.NormalizedName {
switch name {
case "skeleton":
name = "generate-skeleton"
case "out":
name = "output-type"
case "fmt":
name = "format"
}
return pflag.NormalizedName(name)
}
func (p *readParameter) buildFlagsUsage(cmd *cobra.Command) {
var sets []*core.FlagSet
{
var fs *pflag.FlagSet
fs = pflag.NewFlagSet("ipv6addr", pflag.ContinueOnError)
fs.SortFlags = false
fs.AddFlag(cmd.LocalFlags().Lookup("i-pv6-addr"))
sets = append(sets, &core.FlagSet{
Title: "Ipv6addr-specific options",
Flags: fs,
})
}
{
var fs *pflag.FlagSet
fs = pflag.NewFlagSet("zone", pflag.ContinueOnError)
fs.SortFlags = false
fs.AddFlag(cmd.LocalFlags().Lookup("zone"))
sets = append(sets, &core.FlagSet{
Title: "Zone options",
Flags: fs,
})
}
{
var fs *pflag.FlagSet
fs = pflag.NewFlagSet("input", pflag.ContinueOnError)
fs.SortFlags = false
fs.AddFlag(cmd.LocalFlags().Lookup("generate-skeleton"))
fs.AddFlag(cmd.LocalFlags().Lookup("parameters"))
sets = append(sets, &core.FlagSet{
Title: "Input options",
Flags: fs,
})
}
{
var fs *pflag.FlagSet
fs = pflag.NewFlagSet("output", pflag.ContinueOnError)
fs.SortFlags = false
fs.AddFlag(cmd.LocalFlags().Lookup("format"))
fs.AddFlag(cmd.LocalFlags().Lookup("output-type"))
fs.AddFlag(cmd.LocalFlags().Lookup("query"))
fs.AddFlag(cmd.LocalFlags().Lookup("query-driver"))
fs.AddFlag(cmd.LocalFlags().Lookup("quiet"))
sets = append(sets, &core.FlagSet{
Title: "Output options",
Flags: fs,
})
}
{
var fs *pflag.FlagSet
fs = pflag.NewFlagSet("example", pflag.ContinueOnError)
fs.SortFlags = false
fs.AddFlag(cmd.LocalFlags().Lookup("example"))
sets = append(sets, &core.FlagSet{
Title: "Parameter example",
Flags: fs,
})
}
core.BuildFlagsUsage(cmd, sets)
}
func (p *readParameter) setCompletionFunc(cmd *cobra.Command) {
}
func (p *readParameter) SetupCobraCommandFlags(cmd *cobra.Command) {
p.buildFlags(cmd.Flags())
p.buildFlagsUsage(cmd)
p.setCompletionFunc(cmd)
}