Commit Graph

860 Commits

Author SHA1 Message Date
Jesse Szwedko
3ac1e107fe Merge pull request #593 from urfave/command-subcommand-usage-text
Display UsageText on Commands and Subcommands
2017-06-24 20:27:41 -07:00
Jesse Szwedko
3ddfc81916 Merge pull request #626 from urfave/do-not-double-print-before-errors
Do not double print errors from Before()
2017-06-24 20:12:38 -07:00
Jesse Szwedko
4fb301aa38 Merge branch 'master' into invalidate-isset-cache 2017-06-24 20:04:24 -07:00
Jesse Szwedko
48db8e2435 Display UsageText on Commands and Subcommands
If it is set, otherwise build the usage.

Fixes #592
2017-06-24 20:02:36 -07:00
Jesse Szwedko
c64d74a5d9 Do not double print errors from Before()
They should be handled by HandleExitCoder() as `After()` errors are.
2017-06-24 19:57:19 -07:00
Jesse Szwedko
f229e3c59c Merge pull request #629 from josephlr/use-usage-error-for-app
Subcommand OnUsageError should be passed to app
2017-06-24 19:32:30 -07:00
Joe Richey joerichey@google.com
291122b8f0 Subcommand OnUsageError should be passed to app
Not all of the Command components were being passed to the created App
in the startApp function.
2017-06-21 17:55:49 -07:00
Jesse Szwedko
cf33a9befe Merge pull request #586 from minio/extra-info
Add support for custom help templates.
2017-06-11 17:00:38 -07:00
Jesse Szwedko
74811faef3 Merge branch 'master' into extra-info 2017-06-11 16:24:10 -07:00
Jesse Szwedko
db0ff44081 Merge pull request #630 from josephlr/support-custom-flags
Add ability to use custom Flag types
2017-06-11 15:37:36 -07:00
Harshavardhana
dd3849a7e6 Add tests as requested. 2017-05-08 09:53:53 -07:00
Harshavardhana
baa33cb888 Add support for ExtraInfo. 2017-05-08 09:53:53 -07:00
Harshavardhana
f7d6a07f2d Add support for custom help templates. 2017-05-08 09:53:53 -07:00
Joe Richey joerichey@google.com
1794792adf Add ability to use custom Flag types
Users can now use custom flags types (conforming to the Flag interface)
in their applications. They can also use custom flags for the three
global flags (Help, Version, bash completion).
2017-05-05 22:24:14 -07:00
Jesse Szwedko
d70f47eeca Merge pull request #627 from urfave/use-command-context-in-usage-error
Rely on Command context in Run()
2017-05-05 21:25:29 -07:00
Jesse Szwedko
87fe13079e Rely on Command context in Run()
Was previously relying on the parent context which caused things like
`.Command` to not be available to OnUsageError().

Fixes #609
2017-04-24 15:19:34 -07:00
Jesse Szwedko
ab403a54a1 Merge pull request #616 from tbaud0n/master
Fix autocomplete issue when multiple apps run autocomplete from etc/bash_completion.d directory
2017-04-24 14:31:22 -07:00
Jesse Szwedko
d3793766a3 Merge branch 'master' into master 2017-04-24 14:13:35 -07:00
Jesse Szwedko
f6e8084112 Merge remote-tracking branch 'origin/master' into v1 2017-04-24 11:44:41 -07:00
Jesse Szwedko
924042785a Merge pull request #624 from urfave/fetch-needed-commands
Explicitly fetch `goimports`
2017-04-24 11:43:35 -07:00
Jesse Szwedko
1bf0bb96b7 Only support supported Go versions
As described on https://github.com/golang/go/wiki/Go-Release-Cycle

The maintainers do not test compatibility for libraries (e.g. in
golang.org/x/tools) on older versions.
2017-04-24 11:02:41 -07:00
Jesse Szwedko
572dc46db5 Explicitly fetch goimports
Fetching the whole tree was failing on some Go versions and we really
only need goimports.
2017-04-24 10:40:54 -07:00
Tony
b9c5353920 Unset PROG variable to fix issue when mulitple apps run autocomplete from etc/bash_completion.d directory 2017-04-06 15:11:23 +02:00
Jesse Szwedko
8ba6f23b6e Merge pull request #582 from urfave/fix-altsrc-slice-inputs
Fix altsrc slice inputs so that they correctly parse
2017-03-28 18:35:17 -07:00
Jesse Szwedko
beddedeabd Merge branch 'master' into fix-altsrc-slice-inputs 2017-03-27 20:46:54 -07:00
Jesse Szwedko
9e5b04886c Remove logic that exited even if the error was not an OsExiter
This was introduced in #496, but was discovered to be a regression in
the behavior of the library.
2017-03-04 14:33:36 -08:00
Jesse Szwedko
8d8f927bcb Change flag test error checking to use regexp rather than strings
As the error messages changed in 1.8
2017-03-04 14:28:24 -08:00
Jesse Szwedko
2526b57c56 Allow slightly longer lines in Python scripts 2017-02-14 21:17:05 -08:00
Jesse Szwedko
347a9884a8 Merge pull request #589 from josephlr/subcommand-structure
Subcommand structure should be correctly passed to application
2017-01-28 13:39:59 -08:00
Jesse Szwedko
9913f0cef2 Merge branch 'master' into subcommand-structure 2017-01-28 13:35:02 -08:00
Jesse Szwedko
1d38670e45 Merge pull request #587 from guywithnose/master
Pass the ErrWriter on the root app to subcommands
2017-01-28 13:29:39 -08:00
Joe Richey
e109e81e6a Subcommand structure should be correctly copied to main structure 2017-01-23 10:36:28 -08:00
Robert Bittle
4ed366e201
Pass the ErrWriter on the root app to subcommands 2017-01-18 23:29:26 -05:00
Jesse Szwedko
e87dfbb6bb altsrc: Support slices for TOML 2017-01-16 17:34:12 -08:00
Jesse Szwedko
f8347a97c6 Fix altsrc slice inputs so that they correctly parse
Was previously attempting to cast directly from []interface{} to
[]string or []int which Go doesn't support. Instead, we iterate over and
cast each value (error'ing if the value is not the correct format).

Fixes #580
2017-01-16 17:22:11 -08:00
Antonio Fdez
f1be59ff3d added comment to windows filePath check 2017-01-16 17:19:38 -08:00
Antonio Fdez
341ca93b01 fix imports
Sorry, forgot to add imports correctly, needed to edit the file and make the commit using the github online editor, since I can't access from my current location from git.
2017-01-16 17:19:33 -08:00
Antonio Fdez
7b912d9f8f allow to load YAML configuration files on Windows
The funtion `loadDataFrom` does not take care of Windows users since any of the conditions met and it returns an error.

The change looks for the runtime where it's running and then if the filePath contains a `\`
2017-01-16 17:19:29 -08:00
Jesse Szwedko
56a7254df4 Merge pull request #540 from hirose31/fix/handle-multierror
Call HandleExitCoder for all members of MultiError.Errors
2017-01-16 14:20:16 -08:00
HIROSE Masaaki
adec15acf5 Add another ExitCoder to assert that it uses last one 2017-01-13 15:37:09 +09:00
HIROSE Masaaki
286b4b56d9 Document on exit code in case of MultiError is given 2017-01-12 19:12:17 +09:00
HIROSE Masaaki
71ced406af Treat rc first called as exit code
Because default OsExiter is os.Exit.
2017-01-12 18:59:38 +09:00
hirose31
70a2c94089 Merge branch 'master' into fix/handle-multierror 2017-01-12 18:16:34 +09:00
Péter Szilágyi
acc622e5fb
Invalidate context.setFlags cache on modification. 2017-01-11 14:38:54 +02:00
Jesse Szwedko
8ef3805c9d Merge pull request #575 from MaximilianMeister/command-ordering
command: enable ordering commands by name
2017-01-09 20:57:14 -08:00
Joe Richey
0083ae8732 Usage/Description/ArgsUsage correctly copied when using subcommand 2017-01-09 15:57:49 -08:00
Maximilian Meister
ac772237b9
command: enable ordering commands by name 2017-01-09 16:40:32 +01:00
Jesse Szwedko
8f6a3675e1 Merge pull request #581 from appleboy/patch-2
[ci skip] fix template syntax error
2017-01-08 17:29:12 -05:00
Bo-Yi Wu
4267cd827c [ci skip] Fix template syntax error 2017-01-04 10:28:58 +08:00
Jesse Szwedko
4401a6ca20 Merge pull request #566 from fernandezvara/v1
allow to load YAML configuration files on Windows
2016-11-27 13:44:19 -08:00