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
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
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.
9 years ago
Fabian Ruff
65d50017d4
search context hierachy for global flags
9 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
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
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ñé
44efc2952d
Added Before method to command and app
10 years ago
Kyle Allan
156cd267e5
move to CommandNotFound copy to startApp
10 years ago
Audrius Butkevicius
4a645835f0
Add HideHelp flag in App and Command
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
73aae5979c
Merge pull request #80 from wendorf/master
...
Add SkipFlagParsing option to Command
11 years ago
Jeremy Saenz
a502865bb7
Merge pull request #74 from Winslett/context-accessible-command
...
Make Command accessible from Context
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
Summer Mousa
faf2a3d4a3
Added Before method to command. If set, or if command.Subcommands is set, then the command is treated as a recursive subcommand
11 years ago
Summer Mousa
13f0c8c0f6
More consistent implementation of recursive subcommands
11 years ago
Dan Wendorf and Karen Wang
6c5f810d8f
Add SkipFlagParsing option to Command
11 years ago
Summer Mousa
3a10545f91
Made bash completion command optional; still need to update documentation
11 years ago
Summer Mousa
0b29bee364
merging code
11 years ago
Chris Winslett
c69522c960
Make Command accessible from Context
11 years ago
Jeremy Saenz
01b889e637
Merge branch 'master' of github.com:xyproto/cli into xyproto-master
...
Conflicts:
app.go
context.go
11 years ago
Alexander Rødseth
1bea6dcbf0
Custom type for arguments
11 years ago
Jeremy Saenz
ab6f1b7c3c
Formatting
11 years ago
Jeremy Saenz
4120b604ec
Removed help flag. we no longer need it.
11 years ago
Jared Forsyth
dc8a62e0e9
refactor, more robust flag propagation
11 years ago
Alexander Rødseth
f93652a890
Fixed all problems/warnings reported by "go vet"
11 years ago
Jeremy Saenz
b25b7a883c
JMS #39 : Removed all calls to os.Exit().
11 years ago
Jeremy Saenz
0d3c3f4497
Improved documentation
11 years ago
Thesyncim
4d9038a156
add ability to parse []string types
11 years ago
Damien Le Berrigaud
5d511c7a8b
Allow for flags being passed in after arguments
11 years ago