@@ -68,7 +68,7 @@ type Flag interface {
68
68
type errorableFlag interface {
69
69
Flag
70
70
71
- applyWithError (* flag.FlagSet ) error
71
+ ApplyWithError (* flag.FlagSet ) error
72
72
}
73
73
74
74
func flagSet (name string , flags []Flag ) (* flag.FlagSet , error ) {
@@ -77,7 +77,7 @@ func flagSet(name string, flags []Flag) (*flag.FlagSet, error) {
77
77
for _ , f := range flags {
78
78
//TODO remove in v2 when errorableFlag is removed
79
79
if ef , ok := f .(errorableFlag ); ok {
80
- if err := ef .applyWithError (set ); err != nil {
80
+ if err := ef .ApplyWithError (set ); err != nil {
81
81
return nil , err
82
82
}
83
83
} else {
@@ -105,12 +105,12 @@ type Generic interface {
105
105
// provided by the user for parsing by the flag
106
106
// Ignores parsing errors
107
107
func (f GenericFlag ) Apply (set * flag.FlagSet ) {
108
- f .applyWithError (set )
108
+ f .ApplyWithError (set )
109
109
}
110
110
111
- // applyWithError takes the flagset and calls Set on the generic flag with the value
111
+ // ApplyWithError takes the flagset and calls Set on the generic flag with the value
112
112
// provided by the user for parsing by the flag
113
- func (f GenericFlag ) applyWithError (set * flag.FlagSet ) error {
113
+ func (f GenericFlag ) ApplyWithError (set * flag.FlagSet ) error {
114
114
val := f .Value
115
115
if f .EnvVar != "" {
116
116
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
@@ -158,11 +158,11 @@ func (f *StringSlice) Get() interface{} {
158
158
// Apply populates the flag given the flag set and environment
159
159
// Ignores errors
160
160
func (f StringSliceFlag ) Apply (set * flag.FlagSet ) {
161
- f .applyWithError (set )
161
+ f .ApplyWithError (set )
162
162
}
163
163
164
- // applyWithError populates the flag given the flag set and environment
165
- func (f StringSliceFlag ) applyWithError (set * flag.FlagSet ) error {
164
+ // ApplyWithError populates the flag given the flag set and environment
165
+ func (f StringSliceFlag ) ApplyWithError (set * flag.FlagSet ) error {
166
166
if f .EnvVar != "" {
167
167
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
168
168
envVar = strings .TrimSpace (envVar )
@@ -221,11 +221,11 @@ func (f *IntSlice) Get() interface{} {
221
221
// Apply populates the flag given the flag set and environment
222
222
// Ignores errors
223
223
func (f IntSliceFlag ) Apply (set * flag.FlagSet ) {
224
- f .applyWithError (set )
224
+ f .ApplyWithError (set )
225
225
}
226
226
227
- // applyWithError populates the flag given the flag set and environment
228
- func (f IntSliceFlag ) applyWithError (set * flag.FlagSet ) error {
227
+ // ApplyWithError populates the flag given the flag set and environment
228
+ func (f IntSliceFlag ) ApplyWithError (set * flag.FlagSet ) error {
229
229
if f .EnvVar != "" {
230
230
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
231
231
envVar = strings .TrimSpace (envVar )
@@ -284,11 +284,11 @@ func (f *Int64Slice) Get() interface{} {
284
284
// Apply populates the flag given the flag set and environment
285
285
// Ignores errors
286
286
func (f Int64SliceFlag ) Apply (set * flag.FlagSet ) {
287
- f .applyWithError (set )
287
+ f .ApplyWithError (set )
288
288
}
289
289
290
- // applyWithError populates the flag given the flag set and environment
291
- func (f Int64SliceFlag ) applyWithError (set * flag.FlagSet ) error {
290
+ // ApplyWithError populates the flag given the flag set and environment
291
+ func (f Int64SliceFlag ) ApplyWithError (set * flag.FlagSet ) error {
292
292
if f .EnvVar != "" {
293
293
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
294
294
envVar = strings .TrimSpace (envVar )
@@ -318,11 +318,11 @@ func (f Int64SliceFlag) applyWithError(set *flag.FlagSet) error {
318
318
// Apply populates the flag given the flag set and environment
319
319
// Ignores errors
320
320
func (f BoolFlag ) Apply (set * flag.FlagSet ) {
321
- f .applyWithError (set )
321
+ f .ApplyWithError (set )
322
322
}
323
323
324
- // applyWithError populates the flag given the flag set and environment
325
- func (f BoolFlag ) applyWithError (set * flag.FlagSet ) error {
324
+ // ApplyWithError populates the flag given the flag set and environment
325
+ func (f BoolFlag ) ApplyWithError (set * flag.FlagSet ) error {
326
326
val := false
327
327
if f .EnvVar != "" {
328
328
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
@@ -358,11 +358,11 @@ func (f BoolFlag) applyWithError(set *flag.FlagSet) error {
358
358
// Apply populates the flag given the flag set and environment
359
359
// Ignores errors
360
360
func (f BoolTFlag ) Apply (set * flag.FlagSet ) {
361
- f .applyWithError (set )
361
+ f .ApplyWithError (set )
362
362
}
363
363
364
- // applyWithError populates the flag given the flag set and environment
365
- func (f BoolTFlag ) applyWithError (set * flag.FlagSet ) error {
364
+ // ApplyWithError populates the flag given the flag set and environment
365
+ func (f BoolTFlag ) ApplyWithError (set * flag.FlagSet ) error {
366
366
val := true
367
367
if f .EnvVar != "" {
368
368
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
@@ -398,11 +398,11 @@ func (f BoolTFlag) applyWithError(set *flag.FlagSet) error {
398
398
// Apply populates the flag given the flag set and environment
399
399
// Ignores errors
400
400
func (f StringFlag ) Apply (set * flag.FlagSet ) {
401
- f .applyWithError (set )
401
+ f .ApplyWithError (set )
402
402
}
403
403
404
- // applyWithError populates the flag given the flag set and environment
405
- func (f StringFlag ) applyWithError (set * flag.FlagSet ) error {
404
+ // ApplyWithError populates the flag given the flag set and environment
405
+ func (f StringFlag ) ApplyWithError (set * flag.FlagSet ) error {
406
406
if f .EnvVar != "" {
407
407
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
408
408
envVar = strings .TrimSpace (envVar )
@@ -427,11 +427,11 @@ func (f StringFlag) applyWithError(set *flag.FlagSet) error {
427
427
// Apply populates the flag given the flag set and environment
428
428
// Ignores errors
429
429
func (f IntFlag ) Apply (set * flag.FlagSet ) {
430
- f .applyWithError (set )
430
+ f .ApplyWithError (set )
431
431
}
432
432
433
- // applyWithError populates the flag given the flag set and environment
434
- func (f IntFlag ) applyWithError (set * flag.FlagSet ) error {
433
+ // ApplyWithError populates the flag given the flag set and environment
434
+ func (f IntFlag ) ApplyWithError (set * flag.FlagSet ) error {
435
435
if f .EnvVar != "" {
436
436
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
437
437
envVar = strings .TrimSpace (envVar )
@@ -460,11 +460,11 @@ func (f IntFlag) applyWithError(set *flag.FlagSet) error {
460
460
// Apply populates the flag given the flag set and environment
461
461
// Ignores errors
462
462
func (f Int64Flag ) Apply (set * flag.FlagSet ) {
463
- f .applyWithError (set )
463
+ f .ApplyWithError (set )
464
464
}
465
465
466
- // applyWithError populates the flag given the flag set and environment
467
- func (f Int64Flag ) applyWithError (set * flag.FlagSet ) error {
466
+ // ApplyWithError populates the flag given the flag set and environment
467
+ func (f Int64Flag ) ApplyWithError (set * flag.FlagSet ) error {
468
468
if f .EnvVar != "" {
469
469
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
470
470
envVar = strings .TrimSpace (envVar )
@@ -494,11 +494,11 @@ func (f Int64Flag) applyWithError(set *flag.FlagSet) error {
494
494
// Apply populates the flag given the flag set and environment
495
495
// Ignores errors
496
496
func (f UintFlag ) Apply (set * flag.FlagSet ) {
497
- f .applyWithError (set )
497
+ f .ApplyWithError (set )
498
498
}
499
499
500
- // applyWithError populates the flag given the flag set and environment
501
- func (f UintFlag ) applyWithError (set * flag.FlagSet ) error {
500
+ // ApplyWithError populates the flag given the flag set and environment
501
+ func (f UintFlag ) ApplyWithError (set * flag.FlagSet ) error {
502
502
if f .EnvVar != "" {
503
503
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
504
504
envVar = strings .TrimSpace (envVar )
@@ -528,11 +528,11 @@ func (f UintFlag) applyWithError(set *flag.FlagSet) error {
528
528
// Apply populates the flag given the flag set and environment
529
529
// Ignores errors
530
530
func (f Uint64Flag ) Apply (set * flag.FlagSet ) {
531
- f .applyWithError (set )
531
+ f .ApplyWithError (set )
532
532
}
533
533
534
- // applyWithError populates the flag given the flag set and environment
535
- func (f Uint64Flag ) applyWithError (set * flag.FlagSet ) error {
534
+ // ApplyWithError populates the flag given the flag set and environment
535
+ func (f Uint64Flag ) ApplyWithError (set * flag.FlagSet ) error {
536
536
if f .EnvVar != "" {
537
537
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
538
538
envVar = strings .TrimSpace (envVar )
@@ -562,11 +562,11 @@ func (f Uint64Flag) applyWithError(set *flag.FlagSet) error {
562
562
// Apply populates the flag given the flag set and environment
563
563
// Ignores errors
564
564
func (f DurationFlag ) Apply (set * flag.FlagSet ) {
565
- f .applyWithError (set )
565
+ f .ApplyWithError (set )
566
566
}
567
567
568
- // applyWithError populates the flag given the flag set and environment
569
- func (f DurationFlag ) applyWithError (set * flag.FlagSet ) error {
568
+ // ApplyWithError populates the flag given the flag set and environment
569
+ func (f DurationFlag ) ApplyWithError (set * flag.FlagSet ) error {
570
570
if f .EnvVar != "" {
571
571
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
572
572
envVar = strings .TrimSpace (envVar )
@@ -596,11 +596,11 @@ func (f DurationFlag) applyWithError(set *flag.FlagSet) error {
596
596
// Apply populates the flag given the flag set and environment
597
597
// Ignores errors
598
598
func (f Float64Flag ) Apply (set * flag.FlagSet ) {
599
- f .applyWithError (set )
599
+ f .ApplyWithError (set )
600
600
}
601
601
602
- // applyWithError populates the flag given the flag set and environment
603
- func (f Float64Flag ) applyWithError (set * flag.FlagSet ) error {
602
+ // ApplyWithError populates the flag given the flag set and environment
603
+ func (f Float64Flag ) ApplyWithError (set * flag.FlagSet ) error {
604
604
if f .EnvVar != "" {
605
605
for _ , envVar := range strings .Split (f .EnvVar , "," ) {
606
606
envVar = strings .TrimSpace (envVar )
0 commit comments