-
Notifications
You must be signed in to change notification settings - Fork 2
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
flags/pflags: slice/map flags concat/merge & README update #94
Conversation
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Looks good -- just a couple nits.
README.md
Outdated
if dialsErr != nil { | ||
// error handling | ||
} | ||
|
||
// Fill will deep copy the fully-stacked configuration into its argument. | ||
// View returns a pointer to the fully stacked configuration file | ||
// The stacked configuration is populated from the config file, environment | ||
// variables and commandline flags. Can alternatively use |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: dangling sentence here...
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I knew I saw that fragment someplace, but lost track of it 🙁
Removed.
README.md
Outdated
As a result, a commandline with `"--a=b", "--a=c"` may be parsed as `[]string{b,c}`. | ||
|
||
#### Maps | ||
Maps are parsed like Slices, with the addition of `:` separators between keys and values. ([`strconv.Unquote`](https://pkg.go.dev/strconv#Unquote)-compatible quoting is mandatory for more complicated strins as well) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit:
Maps are parsed like Slices, with the addition of `:` separators between keys and values. ([`strconv.Unquote`](https://pkg.go.dev/strconv#Unquote)-compatible quoting is mandatory for more complicated strins as well) | |
Maps are parsed like Slices, with the addition of `:` separators between keys and values. ([`strconv.Unquote`](https://pkg.go.dev/strconv#Unquote)-compatible quoting is mandatory for more complicated strings as well) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
fixed
README.md
Outdated
} | ||
conf, serial := d.ViewVersion() | ||
|
||
// you can get notified whenever the config changes by registering a callback |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
nit: extra indentation
// you can get notified whenever the config changes by registering a callback | |
// You can get notified whenever the config changes by registering a callback. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed the capitalization.
It was actually worse than extra indentation. Somehow, I ended up with spaces instead of tabs, and a tabstop of 4 for some of the new lines. I've fixed that.
It's been a while since it was last updated, and I felt weird adding a section explaining slice parsing without fixing the complete staleness of the readme's examples. - Removed Fill() calls, which are deprecated - Updated ez package references to use Params - Removed type-asserts on View() calls - Removed Events() calls, and updated to the less convoluted callback-based change-notification mechanism.
Instead of always using the last flag value referenced, merge all values present.
50a0e2b
to
839367a
Compare
Update README
It's been a while since it was last updated, and I felt weird adding a
section explaining slice parsing without fixing the complete staleness
of the readme's examples.
callback-based change-notification mechanism.
flags/pflags: slice/map flags concat/merge
Instead of always using the last flag value referenced, merge all values
present.