We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 2b8f132 commit 5cbb658Copy full SHA for 5cbb658
user_options.go
@@ -185,6 +185,13 @@ func (gopt *GetOpt) Value(name string) interface{} {
185
return nil
186
}
187
188
+func (gopt *GetOpt) SetValue(name string, value ...string) error {
189
+ if v, ok := gopt.programTree.ChildOptions[name]; ok {
190
+ return v.Save(value...)
191
+ }
192
+ panic("option not found")
193
+}
194
+
195
// Bool - define a `bool` option and its aliases.
196
// It returns a `*bool` pointing to the variable holding the result.
197
// If the option is found, the result will be the opposite of the provided default.
0 commit comments