-
Notifications
You must be signed in to change notification settings - Fork 1.7k
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
Feat: Convert filepath in Flag to string slice #1601
Conversation
testdata/godoc-v3.x.txt
Outdated
Usage string // usage string for help output | ||
Category string // category of the flag, if any | ||
DefaultText string // default text of the flag for usage purposes | ||
FilePath []string // file paths to load value from |
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.
Should it be named to FilePaths
then?
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.
Thats what I initially was about to do but thought to keep the name same since behavior is same. I can change it. @meatballhat any thoughts ?
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.
With many file paths, what will happen if first path does not exist? Will value from the second path overwrite the first?
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'm in favor of a rename to FilePaths
👍🏼 and to @abitrolly's point it'd be nice to have clearer documentation around the expected behavior 🙇🏼 (in a later PR!)
Not clear how it is supposed to be used. Link to relevant usage examples could help that. |
@abitrolly https://cli.urfave.org/v2/examples/flags/#values-from-files . Previously multiple files would be specified by doing
So this change makes the file paths more explicit
|
@dearchap should the example be updated then?
|
@abitrolly Yes. Maybe we'll do a separate PR to update the docs since this change is going into v3 ? |
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.
Oh! You already renamed to FilePaths
🤦🏼 Thank you!
What type of PR is this?
(REQUIRED)
What this PR does / why we need it:
(REQUIRED)
Which issue(s) this PR fixes:
(REQUIRED)
Fixes #1166
Special notes for your reviewer:
(fill-in or delete this section)
Testing
(fill-in or delete this section)
make test
Release Notes
(REQUIRED)