-
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
Required flags #819
Merged
asahasrabuddhe
merged 63 commits into
urfave:master
from
coilysiren:required-flags-take-2
Aug 2, 2019
Merged
Required flags #819
Changes from all commits
Commits
Show all changes
63 commits
Select commit
Hold shift + click to select a range
7e05320
Implement required flags
73e64a1
Add (required) to help of flags that are required.
4b2fcdb
Add tests for required flags
8f1fb06
Merge pull request #1 from ivey/required_flags
jhowarth cbd9529
Remove debugging
e67e05f
DRY error handling
6023f37
dry error messages
145da32
don't require flags when the help flag is included
b5844af
Merge pull request #2 from ivey/requiredFlags
jhowarth a6482d2
Merge remote-tracking branch 'upstream/master'
aba73ce
Copy the writer of the App to the subcommand App
138dbaa
Merge branch 'master' into required_flags
ce16301
reduce diff???
fa8187f
reduce diff
e6842c0
merge in test file
f7d5e2c
reduce diff
30a71dc
update Run command
9c299e7
reduce diff
0608059
reduce diff
3d2d697
reduce diff
af627c7
update func name
310bfeb
add required attr to generator
62e99ad
add IsRequired to generator
8a58b7e
remove manual isRequired funcs
922d231
./generate-flag-types cli -i flag-types.json -o flag_generated.go
6a2ae78
backwards compatible RequiredFlag implementation
f6777bf
quote the flag name
550ed20
update tests
746866c
add update integration with the help output
80d7e91
fill out test cases
cf82480
update tests
17108e1
tabs
f00f35c
docs
9293f5b
visually shorten logic
cdc7af7
add handling for multiple required flags
01d5cfa
use strings.Join
32d84d8
copy update
coilysiren cc1cf8c
wording shift
3002886
add subcommand
2299852
cleanup subcommand and specs
19140e1
show errors
d8985dc
reduce diff
7ce0af1
remove unused code
23f09ac
cleanup tests, check required flags in more places
9ec594d
reset generated flags changes
386b379
Revert "reset generated flags changes"
9438aba
remove showFlagError, we can use the help printer assertion to accomp…
714a73f
remove unused thing
95d3a86
update test to reflect app flag usage
7b9e16b
update test names
3d6eec8
add test cases
595382c
expand test cases
d4740d1
more test cases
78db152
add typed error assertions
45f2b3d
more test cases
ef9acb4
rename cases
fdd4d10
update comments
f21b22d
cleanup some issues with error display
38f9e16
add environment variable support :tada:
f4128a0
Update command.go
coilysiren d7ec4e8
add env var tests
60fb297
remove help assertion stuff
f8ba505
Merge branch 'master' into required-flags-take-2
asahasrabuddhe File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
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.
this function isn't used anywhere, but I was reading https://dave.cheney.net/2016/04/27/dont-just-check-errors-handle-them-gracefully and it said
So that's what I'm trying to do here? 🤷♀ I'm open to suggestions for improvements!