diff options
| author | Tim Hockin <[email protected]> | 2015-04-23 21:45:29 -0700 |
|---|---|---|
| committer | Tim Hockin <[email protected]> | 2015-04-23 21:45:29 -0700 |
| commit | 4ac8829b5173e7af7ae84e1d477f8c5471cb126c (patch) | |
| tree | 424c2547ffc6c7a662bd375d4c271972c61c5700 /flag_test.go | |
| parent | beb8d730f2afc6c3fe75312ad6f61a3dc47a64aa (diff) | |
Allow WordSeparators to be set after flags are added
Diffstat (limited to 'flag_test.go')
| -rw-r--r-- | flag_test.go | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/flag_test.go b/flag_test.go index 10e6ebb..ca500dd 100644 --- a/flag_test.go +++ b/flag_test.go @@ -238,8 +238,9 @@ func testNormalizedNames(args []string, t *testing.T) { if f.Parsed() { t.Error("f.Parse() = true before Parse") } - f.SetWordSeparators([]string{"-", "_"}) withDashFlag := f.Bool("with-dash-flag", false, "bool value") + // Set this after some flags have been added and before others. + f.SetWordSeparators([]string{"-", "_"}) withUnderFlag := f.Bool("with_under_flag", false, "bool value") withBothFlag := f.Bool("with-both_flag", false, "bool value") if err := f.Parse(args); err != nil { |
