Dan Buch
06c01a4bba
A few tweaks based on feedback in #361
9 years ago
Dan Buch
4cae17cfe1
Ensure MultiError returned when both Before and After funcs given
9 years ago
Dan Buch
b453bf5940
Clarifying errors returned from HandleAction + tests
9 years ago
Dan Buch
271b56c71b
Cleanups based on feedback in #361
9 years ago
Dan Buch
7371138edb
Add back App.RunAndExitOnError with deprecation message
9 years ago
Dan Buch
02924293ff
Removing unused vars
9 years ago
Dan Buch
d45f7c1fe2
Allow for legacy and newer Action func signatures
9 years ago
Dan Buch
f688d47415
Encapsulate ExitCoder check into a lil func
9 years ago
Dan Buch
b7329f4968
Switch from multi-return with exit codes to ExitCoder check
9 years ago
Dan Buch
a17c8cf1d8
Rename func type suffixes `Fn`->`Func` and add `OnUsageErrorFunc`
9 years ago
Dan Buch
10c8309d84
Merge branch 'develop' of https://github.com/txgruppi/cli into txgruppi-develop
9 years ago
Felamande
3fb51f15e8
use filepath.Base instead of path.Base in Name & HelpName as default values.
9 years ago
Jesse Szwedko
bc465beccc
Merge pull request #346 from codegangsta/category_sort_2
...
Add option to make categories with command, to display a more structured help
9 years ago
Radek Simko
d21170f0e3
Never show version if HideVersion=true
9 years ago
Jesse Szwedko
042842b819
Remove CategorizedHelp from App and allow subcommands to have categories
...
Just place all subcommands in categories, the default category will be
"" which will properly format the output (and group commands that have
no category).
Also allow subcommands to have categories.
Lastly, augment the test to check the output.
9 years ago
Soulou
d0997e8f99
Set Categories as a read-only method and fix tests
9 years ago
Soulou
994a7028e2
Categories as slice, not a map anymore, order is always preserved
9 years ago
Soulou
a0801792cc
Allow to sort commands by category
9 years ago
adamclerk
cde8418658
Fixes spelling issues and import alphabetical issues
...
Using goreportcard.com I noticed a few spelling errors. I really love codegangsta/cli
and wanted to help improve it.
9 years ago
Jesse Szwedko
d5f087da9d
Merge pull request #289 from KSubedi/master
...
Added command to have a custom text on the USAGE section of help
9 years ago
Gregor Noczinski
66c1742012
* Fixed typos
9 years ago
Gregor Noczinski
c462071a52
* Added ability to customize usage error messages
9 years ago
leonardyp
6f6e8caf6c
Repeat context statement because of a is a pointer
...
performance optimization
gofmt code
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
Kaushal Subedi
c70ad9b688
fixed tests
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
Tarcísio Gruppi
49c1229409
Added exit code support
...
Now the exit code can be returned by BeforeFn, ActionFn and AfterFn.
The `os.Exit` function is not called by this packaged
This closes #66 and closes #164
9 years ago
Tarcísio Gruppi
9c0db3f4ac
Created types for functions
...
The function used by BashComplete, Before, After, Action and
CommandNotFound have their won type.
This makes easier to change/update the API
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