Robert Liebowitz
03153b9cf8
Allow combining short flags globally
5 years ago
Lynn Cyrin
38f9e1622d
add environment variable support 🎉
5 years ago
Lynn Cyrin
f21b22dd90
cleanup some issues with error display
5 years ago
Lynn Cyrin
714a73f028
remove unused thing
5 years ago
Lynn Cyrin
9438aba3b8
remove showFlagError, we can use the help printer assertion to accomplish the same goal
5 years ago
Lynn Cyrin
23f09ac1e8
cleanup tests, check required flags in more places
5 years ago
Lynn Cyrin
d8985dc6d5
reduce diff
5 years ago
Lynn Cyrin
19140e1fb5
show errors
5 years ago
Lynn Cyrin
2299852c3c
cleanup subcommand and specs
5 years ago
Lynn Cyrin
cf824804c2
update tests
5 years ago
Lynn Cyrin
746866c10d
add update integration with the help output
5 years ago
Lynn Cyrin
9c299e7e8a
reduce diff
5 years ago
Lynn Cyrin
30a71dc427
update Run command
5 years ago
Lynn Cyrin
138dbaafec
Merge branch 'master' into required_flags
5 years ago
Iskander (Alex) Sharipov
5b83c895a7
use type switch instead of if/else
...
This reduces the syntax noise of the code by
removing excessive type assertions.
Signed-off-by: Iskander Sharipov <quasilyte@gmail.com>
6 years ago
Gábor Lipták
c6eb2a0510
Correct go vet for Go tip
...
https://travis-ci.org/cloudflare/logshare/jobs/309796141#L646
7 years ago
Tyler Davis
40263f4d6a
Merge branch 'master' into master
7 years ago
Sebastian Sprenger
c202606a17
fix golint issues
7 years ago
Tyler Davis
172bb92059
fix named parameter issue
7 years ago
Tyler Davis
530df59178
Pass context into handleExitCoder
7 years ago
Tyler Davis
ceee6408d5
Revert "Fix how to do defaults in app.go"
...
This reverts commit 8906567dc2ad52fd31c50cf02fa606505a1323ba.
7 years ago
Tyler Davis
80b09a4d11
Fix how to do defaults in app.go
7 years ago
Tyler Davis
827da610b4
Add a bit more documentation
7 years ago
Tyler Davis
c48a829640
Allow custom exit err handlers
7 years ago
Jesse Szwedko
c64d74a5d9
Do not double print errors from Before()
...
They should be handled by HandleExitCoder() as `After()` errors are.
7 years ago
Harshavardhana
baa33cb888
Add support for ExtraInfo.
7 years ago
Harshavardhana
f7d6a07f2d
Add support for custom help templates.
7 years ago
Kasey Klipsch
8fa549846e
#556 broke the api for users who were using the ActionFunc
8 years ago
Joshua Rubin
2da42640ad
Merge remote-tracking branch 'origin/master' into completion_fix
8 years ago
Joshua Rubin
8dd1962f7b
change "complete" to "shellComplete"
8 years ago
Jesse Szwedko
e367fafa3d
Return an error when parsing environment variables for values fails
...
Currently cli silently (aside from IntSlice and Int64Slice which oddly
printed directly to the error stream) ignores failures that occur when
parsing environment variables for their value for flags that define
environment variables. Instead, we should propogate up the error to the
user.
This is accomplished in a backwards compatible manner by adding a new,
internal, interface which defines an applyWithError function that all
flags here define. In v2, when we can modify the interface, we can drop
this secondary interface and modify `Apply` to return an error.
8 years ago
Jesse Szwedko
0113f56d10
If no action is specified on the command or app, print the help documentation
...
Rather than panic'ing or displaying an opaque error message about the
signature which is more confusing to the end user.
Fixes #562
8 years ago
Joshua Rubin
ea3df26e64
make shell autocomplete more robust
8 years ago
Jesse Szwedko
b377b5d9e9
Use type assertions rather than reflection to determine how to call the `Action`
...
This has some benefits, but results in possibly less informative error
messaging; however, given that there are only two accepted types,
I think the error messaging is sufficient.
8 years ago
Jesse Szwedko
61db37e7ae
Merge branch 'master' into default-writer
8 years ago
Jesse Szwedko
f614c177b7
Merge pull request #543 from wking/app-description
...
app: Add App.Description
8 years ago
W. Trevor King
0c143a2a26
app: Fix trailing space for Author.String()
...
This code initially landed with lots of space:
'{name} <{email}> '
or:
'{name} '
in 3d718330
(app, help: add support for multiple authors, 2015-01-31).
The doubled space between the name and email was removed in c6592bb4
(app, help: add backwards compatibility for Authors, 2015-02-21), but
a trailing space remained in both the email and email-less cases.
This commit removes that trailing space.
8 years ago
Richard Kovacs
4cc2bad36e
Display error instead of just say command is incorrect
8 years ago
Jesse Szwedko
508a23430b
Default app.Writer to os.Stdout
...
As NewApp() does.
Fixes #545
8 years ago
W. Trevor King
c4a46a7df2
app: Add App.Description
...
So you can describe what the application is for without requiring
users to drill down into a particular command.
8 years ago
Jesse Szwedko
a5ca09a934
fixup! remove the possiblity of end-user's seeing deprecation warnings
8 years ago
Jesse Szwedko
8e6aa34a12
remove the possiblity of end-user's seeing deprecation warnings
...
Instead use deprecation pattern described in
https://blog.golang.org/godoc-documenting-go-code .
Fixes #507
8 years ago
Radek Simko
bef215fe3e
app: Allocate Metadata map automatically
8 years ago
Dan Buch
5c7afce5b8
Add help command before category scan/sort
8 years ago
Dan Buch
5a3515fdf8
Focus on catching fewer panics in HandleAction
...
so that "unknown" panics can still bubble up.
8 years ago
Jesse Szwedko
024b4c6240
Update references to codegangsta to urfave (new org name)
...
Also add notice to README
8 years ago
Matt Farina
07ce8bf79c
Cleaned up else per golint
...
When an if ends in a return the else is not required. golint
detects these conditions and found these.
8 years ago
Matt Farina
2f110bd745
Cleaned up exported func comments per golint
8 years ago
Matt Farina
2f4ec31264
Fixed spelling and gofmt issues
8 years ago
Dan Buch
97d2df6dd7
Merge remote-tracking branch 'origin/master' into psmit-hidden_command
8 years ago