Gregor Noczinski
7319f042e4
* Added ability to customize usage error messages
9 years ago
Gregor Noczinski
f3c8e07836
Also show help if App/Command Before produces error.
9 years ago
Yagnesh Mistry
b0b9bd5dac
use path.Base in Name & HelpName as default values
9 years ago
Jacopo
4a8406ac89
Run check completion before error checking
...
Running check completion before error checking allows for completion of flags when no character has been typed yet
9 years ago
Ryan Graham
732e97aee8
only display app version and help message once
...
When processing the flags for -h/--help and -v/--version, only check
the flags in checkVersion() and checkHelp() instead of also printing
the associated message.
This fixes the problem of `app -h` and `app -v` printing their output
twice. The doubling was caused by printing the message once for each
registred alias for the given flags (-h/--help and -v/--version).
Resolves #285
9 years ago
Jesse Szwedko
9039757268
Merge pull request #267 from tristanz/master
...
Add ArgsUsage field to document the use of arguments
9 years ago
Nodir Turakulov
c80fcac42b
Honor HideHelp and HideVersion
...
App.Run does not check a.Hide{Help,Version} before checking it,
as a result customers cannot define their own -v flag (e.g. for verbose)
9 years ago
Tristan Zajonc
c7aac252f1
add tests
9 years ago
Tristan Zajonc
cc46ca1020
allow overriding help name
9 years ago
Tristan Zajonc
aced6e8739
fix tests
9 years ago
Tristan Zajonc
ef65245544
add ArgsUsage to App and Command
9 years ago
Martin Falatic
ee2cde7a77
Print blank lines in help and error outputs more consistently.
9 years ago
Jesse Szwedko
7ad88c2740
Merge pull request #238 from polds/copyright
...
Add the ability to add a copyright
9 years ago
Mawueli Kofi Adzoe
c7be972e81
Fix tiny typo.
9 years ago
Peter Olds
2726643347
Add the ability to add a copyright
...
Signed-off-by: Peter Olds <polds@kyanicorp.com>
9 years ago
Jesse Szwedko
55b8924c2b
Merge pull request #230 from codegangsta/do-not-swallow-after-error
...
Aggregate errors from Before/After
9 years ago
Jesse Szwedko
7ed7a51f86
Aggregate errors from Before/After
...
Previously `After` would overwrite any error from `Before`.
9 years ago
Fabian Ruff
65d50017d4
search context hierachy for global flags
9 years ago
jszwedko
e842547421
Readd printHelp function back
...
But update signature to take a writer. This is a backwards incompatible
change for those overriding the HelpPrinter, but the hope is that this
feature is largely unused and the usage is easily updated.
10 years ago
Dan Buch
2bcd11f863
Merge pull request #193 from codegangsta/add-aliases
...
Add `Command.Aliases` and deprecate `Command.ShortName`
10 years ago
jszwedko
b95607c608
Use named struct fields
10 years ago
jszwedko
7beac44ab1
Don't default authors
10 years ago
jszwedko
5f95a9e88b
Fix support for deprecated author fields
...
Should add an author if either name or email is specified.
10 years ago
jszwedko
bf65971a6a
Add `Command.Aliases` and deprecate `Command.ShortName`
...
`Aliases` will be more flexible while still allowing "ShortName"
behaviour via `Aliases`.
10 years ago
jszwedko
01cdaa065a
Merge remote-tracking branch 'origin/master' into add-multi-author-support
...
Conflicts:
app.go
10 years ago
Harrison
c6592bb487
app, help: add backwards compatibility for Authors
10 years ago
jszwedko
50c77ecec0
Fix comments for .After field on Command and App
10 years ago
Jesse Szwedko
532d0bc2e3
Merge pull request #151 from imdario/master
...
After: companion action for Before
10 years ago
Harrison
3d7183307a
app, help: add support for multiple authors
10 years ago
Dario Castañé
dca177c384
After handler brought up to speed.
...
As discussed in issue #151 , I modified the implementation to be simpler.
I checked how to propagate err, being done with a scope trick. From our
deferred function we cannot return a new value, so we override the "default"
return value (err), declared on functions' declarations.
Check this StackOverflow for more info: http://stackoverflow.com/a/19934989
10 years ago
Dario Castañé
4ab12cd639
jszwedko's suggestion done
10 years ago
Dario Castañé
4e3a83b43e
Merge branch 'master' of https://github.com/codegangsta/cli
...
Conflicts:
app.go
app_test.go
10 years ago
jszwedko
5159b98cbc
Use parsed context when running command as subcommnd
...
Rather than passing the unparsed context (parent context) in whenever
there are no subcommands.
10 years ago
Dan Buch
5b9e204508
Merge pull request #153 from codegangsta/allow-hiding-of-help-flag
...
Allow hiding of help flag without hiding help subcommand
10 years ago
jszwedko
e72094e6a4
Prefer fmt.Fprint* functions over io.WriteString
...
Less composition needed.
10 years ago
jszwedko
b8c8282de5
Merge remote-tracking branch 'origin/master' into allow-writer-to-be-set
...
Conflicts:
app.go
help.go
10 years ago
jszwedko
0d4870d63e
Rename Stdout -> Writer
10 years ago
jszwedko
780f839a02
Allow hiding of help flag without hiding help subcommand
...
By utilizing struct zero value
10 years ago
Dario Castañé
3c4b583fee
Action error shadowing avoided on After
10 years ago
Dario Castañé
44efc2952d
Added Before method to command and app
10 years ago
Peter Bourgon
179c7a5f7c
Make -v, --version optional
10 years ago
Audrius Butkevicius
e38bac8225
Print author
10 years ago
Jeremy Saenz
8c34b12d83
Merge pull request #114 from AudriusButkevicius/shortcut
...
Add App.RunAndExitOnError shortcut
10 years ago
Audrius Butkevicius
449f261ee9
Add App.RunAndExitOnError shortcut
10 years ago
Audrius Butkevicius
4a645835f0
Add HideHelp flag in App and Command
10 years ago
Philippe Lafoucrière
df5fb46048
Fix global flags in Subcommands
...
closes #69
10 years ago
John Hopper
60e3dcaf6d
Allow a writer to be set that represents Stdout so that redirection of App output may occur.
10 years ago
Summer Mousa
a911ec75e4
Can now change these default flags in other applications
11 years ago
Jeremy Saenz
5e1cde20d3
Merge pull request #75 from Winslett/command-not-found
...
Customizable command not found function
11 years ago
Summer Mousa
2535376782
If the Subcommand is instantiated, via the Before method and has no subcommands, display the CommandHelp instead of the SubcommandHelp
11 years ago