Dan Buch
32ebecfbb5
Merge remote-tracking branch 'origin/master' into v2
9 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.
9 years ago
Matt Farina
2f110bd745
Cleaned up exported func comments per golint
9 years ago
Dan Buch
bac790c819
Merge remote-tracking branch 'origin/master' into v2
9 years ago
Jesse Szwedko
f585ec7cb8
Remove reordering of flags and arguments
...
This was introduced by #36 , but only worked in the specific case of all
arguments being passed before all flags. If the user mixed them, they
ended up with odd parsing behavior where the arguments were reordered
(causing #103 and #355 ).
Given the tradeoffs I think we should remove support for flag
reordering.
Fixes #103
Fixes #355
9 years ago
Dan Buch
5c641d69b4
Merge branch 'hidden_command' of https://github.com/psmit/cli into psmit-hidden_command
9 years ago
Dan Buch
fed78b8bab
Rework of hidden flag impl plus some Action func corrections
9 years ago
Dan Buch
e671f0b23b
Merge pull request #339 from jack230230/master
...
Add App.Metadata
9 years ago
王振威
f72d405107
Change Extras to Metadata
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
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
a0801792cc
Allow to sort commands by category
9 years ago
王振威
88ea7cbec8
Add App extras info
9 years ago
Uwe Dauernheim
a755a95d01
Fix semantic typo
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
Andreas Kupries
bb4e78eb6a
Fixed mishandling of a "-"(dash)-argument causing reordering of cli non-flag arguments.
...
Added test demonstrating issue (PASS with fix, FAIL without).
9 years ago
Gregor Noczinski
f3c8e07836
Also show help if App/Command Before produces error.
9 years ago
Gregor Noczinski
f90cd56647
Handle Before and After of Command without handling it as subCommand if there is no subCommand.
9 years ago
Jesse Szwedko
6191d931b7
When skipping flag parsing, still parse into arguments
...
Fool the FlagSet into thinking that all arguments are actually
arguments rather than attempting to parse them as flags.
9 years ago
Jesse Szwedko
bc3cb33cef
Actually skip parsing of flags if SkipFlagParsing is set
...
Previous just skipped if firstFlagIndex was > -1
9 years ago
Nathan LeClaire
c538c376c9
Do not return error when flag parsing should be skipped
...
Signed-off-by: Nathan LeClaire <nathan.leclaire@gmail.com>
9 years ago
Kaushal Subedi
8b46886de8
added flag to have a custom text on the USAGE section of help
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
ecb0b5ac0a
improve help by including parent command for subcommands
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
Brian Goff
758ad1e836
Sets a subcommand's parent cmd
...
This allows the help output to show the correct/full command path to the
subcommand.
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
9 years ago
Martin Falatic
ee2cde7a77
Print blank lines in help and error outputs more consistently.
10 years ago
Fabian Ruff
65d50017d4
search context hierachy for global flags
10 years ago
jszwedko
a889873af5
Set additional information on command's 'app'
...
For completeness
10 years ago
jszwedko
b8104e5da7
Set writer when running command as app
...
Also add test from https://github.com/codegangsta/cli/pull/202 with
slight modifications.
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
Nicolas Dufour
4be878bffc
Fixing the issue with a command with subcommands not showing help message.
...
- the command name is "" and HasName was returning true for an empty
ShortName.
- the Show method wasn't aware that command name was just "" and
returned the first subcommand.
10 years ago
jszwedko
50c77ecec0
Fix comments for .After field on Command and App
10 years ago
Peter Smit
5308b4cd0f
Allow commands to be hidden from help and autocomplete
10 years ago
Dario Castañé
4e3a83b43e
Merge branch 'master' of https://github.com/codegangsta/cli
...
Conflicts:
app.go
app_test.go
10 years ago
Jesse Szwedko
bf4a526f48
Merge pull request #157 from dajulia3/pull_request
...
stop flag parsing after terminator --
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
Matthew McNew
d05d895492
stop flag parsing after terminator --
...
Signed-off-by: David Wadden <dwadden@pivotal.io>
10 years ago
jszwedko
e72094e6a4
Prefer fmt.Fprint* functions over io.WriteString
...
Less composition needed.
10 years ago