MCPcopy Create free account
hub / github.com/hashicorp/vault / Flags

Method Flags

command/kv_patch.go:93–136  ·  view source on GitHub ↗
()

Source from the content-addressed store, hash-verified

91}
92
93func (c *KVPatchCommand) Flags() *FlagSets {
94 set := c.flagSet(FlagSetHTTP | FlagSetOutputField | FlagSetOutputFormat)
95
96 // Patch specific options
97 f := set.NewFlagSet("Common Options")
98
99 f.IntVar(&IntVar{
100 Name: "cas",
101 Target: &c.flagCAS,
102 Default: 0,
103 Usage: `Specifies to use a Check-And-Set operation. If set to 0 or not
104 set, the patch will be allowed. If the index is non-zero the patch will
105 only be allowed if the key’s current version matches the version
106 specified in the cas parameter.`,
107 })
108
109 f.StringVar(&StringVar{
110 Name: "method",
111 Target: &c.flagMethod,
112 Usage: `Specifies which method of patching to use. If set to "patch", then
113 an HTTP PATCH request will be issued. If set to "rw", then a read will be
114 performed, then a local update, followed by a remote update.`,
115 })
116
117 f.StringVar(&StringVar{
118 Name: "mount",
119 Target: &c.flagMount,
120 Default: "", // no default, because the handling of the next arg is determined by whether this flag has a value
121 Usage: `Specifies the path where the KV backend is mounted. If specified,
122 the next argument will be interpreted as the secret path. If this flag is
123 not specified, the next argument will be interpreted as the combined mount
124 path and secret path, with /data/ automatically appended between KV
125 v2 secrets.`,
126 })
127
128 f.StringSliceVar(&StringSliceVar{
129 Name: "remove-data",
130 Target: &c.flagRemoveData,
131 Default: []string{},
132 Usage: "Key to remove from data. To specify multiple values, specify this flag multiple times.",
133 })
134
135 return set
136}
137
138func (c *KVPatchCommand) AutocompleteArgs() complete.Predictor {
139 return c.PredictVaultFiles()

Callers 3

HelpMethod · 0.95
AutocompleteFlagsMethod · 0.95
RunMethod · 0.95

Calls 5

IntVarMethod · 0.95
StringVarMethod · 0.95
StringSliceVarMethod · 0.95
flagSetMethod · 0.80
NewFlagSetMethod · 0.80

Tested by

no test coverage detected