Emil Thelin
a9585bb11c
Added a flag for TestCommandIgnoreFlags
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
Jesse Szwedko
a65b733b30
Merge pull request #275 from langri-sha/master
...
Improve formatting
9 years ago
Filip Dupanović
4ad8f298e2
Improve formatting
9 years ago
Jesse Szwedko
eaad6fe6bc
Merge pull request #274 from klueska/bash-completion-default-prog
...
Set default PROG in bash_autocomplete
9 years ago
Kevin Klues
543102d9c3
Set default PROG in bash_autocomplete
...
By setting the default value of PROG to the basname of whatever the
filename is, we allow bash_autocomplete to be copied into
/etc/bash_completion.d without modification.
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
Jesse Szwedko
142e6cd241
Merge pull request #264 from wardn/master
...
Improve vendoring options by removing self-referential imports in tests.
9 years ago
Tarcísio Gruppi
1510d7e722
Updated tests to support exit code
9 years ago
Tarcísio Gruppi
b79f884410
Updated README.md with exit code sample
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
Edward Sheffler III
8ea1232ede
Improve vendoring options by removing self-referential imports in tests.
9 years ago
Jesse Szwedko
bca61c476e
Merge pull request #246 from cpuguy83/propigate_cmd_parent_to_app_setup
...
Sets a subcommand's parent cmd
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
Jesse Szwedko
f9982619cc
Merge pull request #251 from MartyMacGyver/more-cleanups
...
More cleanups
9 years ago
Jesse Szwedko
b6d983e02c
Merge pull request #253 from databus23/fix-isssue-252
...
Fix global flags processing on top level
9 years ago
Fabian Ruff
a2d4ae5939
Fix global flags processing on top level
...
This fixes a regression introduced by #227 . When looking up global flags by walking up the parent context's we need to consider the special case when we are starting at the very top and there is no parent context to start the traversal.
Fixes #252
9 years ago
Martin Falatic
8cae4991af
Fixing more formatting
9 years ago
Martin Falatic
4d3820c145
If there are no commands, don't show Commands section. Also fixed Copyright section formatting.
9 years ago
Martin Falatic
dbde3303cf
Test updated
9 years ago
Martin Falatic
595c055010
If Version is an empty string, suppress version output in usage help.
9 years ago
Martin Falatic
ee2cde7a77
Print blank lines in help and error outputs more consistently.
9 years ago
Jesse Szwedko
ad480243a8
Merge pull request #245 from cpuguy83/get_parent_ctx
...
Add func to get context parent
9 years ago
Brian Goff
15e6b2fcc7
Add func to get context parent
...
Signed-off-by: Brian Goff <cpuguy83@gmail.com>
9 years ago
Jesse Szwedko
7ad88c2740
Merge pull request #238 from polds/copyright
...
Add the ability to add a copyright
9 years ago
Peter Olds
4a11a6ba05
Remove whitespace #238
...
Signed-off-by: Peter Olds <polds@kyanicorp.com>
9 years ago
Jesse Szwedko
8cbee4b719
Merge pull request #244 from wallclockbuilder/patch-1
...
Fix tiny typo.
9 years ago
Mawueli Kofi Adzoe
c7be972e81
Fix tiny typo.
9 years ago
Jesse Szwedko
11ce503420
Merge pull request #241 from codegangsta/travis-update
...
Update Travis config to run against more versions on faster CI
9 years ago
Dan Buch
474704ba13
Merge pull request #232 from codegangsta/fix-231
...
Version and help check should look for local flags too
9 years ago
Dan Buch
e04e926f10
Update Travis config to run against more versions on faster CI
9 years ago
Dan Buch
4407569431
Merge branch 'master' into fix-231
9 years ago
Peter Olds
2726643347
Add the ability to add a copyright
...
Signed-off-by: Peter Olds <polds@kyanicorp.com>
9 years ago
bryanl
a3b93076ff
Allow context value to be set after parse
...
This change allows a context value to be set after parsing. The use case is updating default settings in a Before func.
An example usage:
```
f, err := os.Open(configPath)
if err == nil {
config, err := docli.NewConfig(f)
if err != nil {
panic(err)
}
c.Set("token", config.APIKey)
}
```
9 years ago
Jesse Szwedko
616b730509
Merge pull request #233 from codegangsta/add-flag-docs
...
Add godoc comments to flag structs
9 years ago
Jesse Szwedko
005b120d20
Add godoc comments to flag structs
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
2272dad83e
Version and help check should look for local flags too
...
Now that Global looks up the chain of contexts, the top level should
access the flags without the prefix (i.e. Bool rather than GlobalBool).
9 years ago
Jesse Szwedko
854c52192c
Merge pull request #227 from databus23/global-flags-from-all-parents
...
Collect global flags from the full command hierarchy
9 years ago
Jesse Szwedko
7ed7a51f86
Aggregate errors from Before/After
...
Previously `After` would overwrite any error from `Before`.
9 years ago
Jesse Szwedko
5d58d5b313
Merge pull request #229 from saromanov/fix-missing-value
...
Fix panic if Valus in Int/StringSliceFlasg is missing
9 years ago
Sergey Romanov
f47f7b7e85
Fix panic if Valus in Int/StringSliceFlasg is missing
9 years ago
Fabian Ruff
65d50017d4
search context hierachy for global flags
9 years ago
Victor Vieux
35ac968c9e
upate string slice usage
...
Signed-off-by: Victor Vieux <victorvieux@gmail.com>
10 years ago
jszwedko
942282e931
Add instructions for distributing bash completion
...
[ci skip]
10 years ago