Commit Graph
100 Commits
Author SHA1 Message Date
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.
2016-03-20 12:17:13 -07:00
Jesse Szwedko aca5b047ed Drop support for Go 1.0.3
Incompatible with the new alternate input sources and I don't see
a compelling reason to continue its support.
2016-03-06 20:12:29 -08:00
Jesse Szwedko 6bb6787f33 Merge pull request #306 from ChrisPRobinson/inputfilesupport
Update to add yaml support
2016-03-06 20:12:11 -08:00
Jesse Szwedko a2943485b1 Merge pull request #336 from muraty/master
Add NArg method to context
2016-02-27 08:56:50 -08:00
Jesse Szwedko 5db74198de Merge pull request #334 from djui/patch-1
Fix semantic typo
2016-02-17 19:24:44 -08:00
Jesse Szwedko 0ab42fd482 Merge pull request #332 from adamclerk/fix/spellingErrors
Fixes spelling issues and import alphabetical issues
2016-02-09 20:42:30 -08:00
Jesse Szwedko 8cea2901d4 Merge pull request #331 from blaubaer/windows-ci
Added ci configuration for windows using AppVeyor
2016-02-08 21:40:34 -08:00
Jesse Szwedko d5f087da9d Merge pull request #289 from KSubedi/master
Added command to have a custom text on the USAGE section of help
2016-02-06 13:12:10 -08:00
Jesse Szwedko 94d8ca740d Merge pull request #321 from blaubaer/master
Improve help messages for empty strings and do os specific envVar handling on windows
2016-02-06 13:06:44 -08:00
Jesse Szwedko 3565e5dfe6 Merge pull request #322 from blaubaer/custom-error-handling
Introduce custom usage error handling
2016-02-06 12:58:47 -08:00
Jesse Szwedko 0d23d77bee Merge pull request #329 from leonardyp/master
optimization of some places
2016-02-06 11:30:49 -08:00
Jesse Szwedko cf1f63a727 Merge pull request #323 from hpcloud/master
Fixed mishandling of a "-"(dash)-argument causing reordering of cli n…
2016-01-29 19:19:57 -08:00
Jesse Szwedko 114097b816 Merge pull request #326 from tcyrus/patch-1
Update README.md
2016-01-28 18:17:57 -08:00
Jesse Szwedko f9cc3001e0 Merge pull request #315 from blaubaer/master
Improved Before/After handling for Commands
2016-01-21 21:44:38 -08:00
Jesse Szwedko ca6f864fa3 Merge pull request #320 from technosophos/master
Remove panic from help.
2016-01-21 21:11:01 -08:00
Jesse Szwedko c31a797586 Merge pull request #311 from Jille/exportFlagNames
Export cli.Flag.GetName (previously cli.Flag.getName)
2015-12-21 13:40:36 -05:00
Jesse Szwedko 8eb7738f18 Merge pull request #312 from ysh7/master
use path.Base in Name & HelpName as default values
2015-12-21 13:39:19 -05:00
Jesse Szwedko b5232bb293 Merge pull request #309 from dedalusj/check-completion-order
Run check completion before error checking
2015-12-12 19:52:18 -05:00
Jesse Szwedko a3c75bc94e Merge pull request #304 from osocurioso/silence-tests
test: avoid output from "go test" when tests pass
2015-12-12 17:25:10 -05:00
Jesse Szwedko 0302d3914d Merge pull request #283 from codegangsta/really-skip-flag-parsing
Really skip flag parsing
2015-11-20 13:56:42 -08:00
Jesse Szwedko c75c9d0182 Merge pull request #298 from codegangsta/use-correct-example-naming
Use correct example naming and test on Go tip
2015-11-15 13:47:47 -08:00
Jesse Szwedko 0f218fffa5 Remave cli_test.go
Examples are redundant with the ones in app_test.go
2015-11-15 13:34:53 -08:00
Jesse Szwedko 631930114f Also test on Go tip
But allow it to fail
2015-11-15 13:14:18 -08:00
Jesse Szwedko 4fc241fb17 Update examples to use correct naming convention
See https://golang.org/pkg/testing/#hdr-Examples
2015-11-15 13:14:11 -08:00
Jesse Szwedko 49bed4ccde Merge pull request #295 from rosenhouse/update-travis-versions
Update golang versions used by Travis CI
2015-11-15 13:05:45 -08:00
Jesse Szwedko 93b4ad6d1f Merge pull request #297 from ston1th/master
Added destination scan support for flags
2015-11-15 12:34:56 -08:00
Jesse Szwedko 8cd49b108c Update TestCommandIgnoreFlagsIncludingFirstArgument to test for arguments 2015-10-29 20:16:35 -07:00
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.
2015-10-29 20:16:35 -07:00
Jesse Szwedko bc3cb33cef Actually skip parsing of flags if SkipFlagParsing is set
Previous just skipped if firstFlagIndex was > -1
2015-10-29 20:16:35 -07:00
Jesse Szwedko 70e3fa51eb Merge pull request #292 from Jille/remove-unused-var
bash_autocomplete: Remove unused local variable prev
2015-10-29 20:11:27 -07:00
Jesse Szwedko f445c89440 Merge pull request #284 from rbjorklin/readme-update
Added coverage and reference logos to README.md
2015-10-21 22:00:38 -07:00
Jesse Szwedko cffab77ecb Merge pull request #286 from mktmpio/dedup-help-and-version
only display app version and help message once
2015-10-18 17:28:50 -07:00
Jesse Szwedko aba9469083 Merge pull request #282 from cactus/master
make help and version parsing use actual specified values
2015-10-17 11:54:49 -07:00
Jesse Szwedko 96f1fedb28 Merge pull request #281 from thiderman/patch-1
Remove 'bitchass' from README
2015-10-06 19:46:01 -07:00
Jesse Szwedko 9039757268 Merge pull request #267 from tristanz/master
Add ArgsUsage field to document the use of arguments
2015-10-06 19:45:04 -07:00
Jesse Szwedko 88df06b5e3 Merge pull request #279 from nodirt/version
Honor HideHelp and HideVersion
2015-10-05 20:26:32 -07:00
Jesse Szwedko f35cf683a8 Merge pull request #280 from gummiboll/fix-for-testcommandignoreflags
Added a flag for TestCommandIgnoreFlags
2015-10-05 20:05:46 -07:00
Jesse Szwedko a65b733b30 Merge pull request #275 from langri-sha/master
Improve formatting
2015-09-08 18:48:53 -07:00
Jesse Szwedko eaad6fe6bc Merge pull request #274 from klueska/bash-completion-default-prog
Set default PROG in bash_autocomplete
2015-09-05 14:07:14 -07:00
Jesse Szwedko 142e6cd241 Merge pull request #264 from wardn/master
Improve vendoring options by removing self-referential imports in tests.
2015-08-11 21:22:59 -07:00
Jesse Szwedko bca61c476e Merge pull request #246 from cpuguy83/propigate_cmd_parent_to_app_setup
Sets a subcommand's parent cmd
2015-07-11 14:54:04 -07:00
Jesse Szwedko f9982619cc Merge pull request #251 from MartyMacGyver/more-cleanups
More cleanups
2015-06-30 20:15:21 -07:00
Jesse Szwedko b6d983e02c Merge pull request #253 from databus23/fix-isssue-252
Fix global flags processing on top level
2015-06-29 21:01:06 -07:00
Jesse Szwedko ad480243a8 Merge pull request #245 from cpuguy83/get_parent_ctx
Add func to get context parent
2015-06-20 11:34:02 -07:00
Jesse Szwedko 7ad88c2740 Merge pull request #238 from polds/copyright
Add the ability to add a copyright
2015-06-16 19:39:24 -07:00
Jesse Szwedko 8cbee4b719 Merge pull request #244 from wallclockbuilder/patch-1
Fix tiny typo.
2015-06-11 17:23:08 -05:00
Jesse Szwedko 11ce503420 Merge pull request #241 from codegangsta/travis-update
Update Travis config to run against more versions on faster CI
2015-06-11 00:35:07 -05:00
Jesse Szwedko 616b730509 Merge pull request #233 from codegangsta/add-flag-docs
Add godoc comments to flag structs
2015-06-05 09:38:13 -07:00
Jesse Szwedko 005b120d20 Add godoc comments to flag structs 2015-06-02 20:51:09 -07:00
Jesse Szwedko 55b8924c2b Merge pull request #230 from codegangsta/do-not-swallow-after-error
Aggregate errors from Before/After
2015-06-02 20:29:44 -07:00
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).
2015-06-02 20:16:44 -07:00
Jesse Szwedko 854c52192c Merge pull request #227 from databus23/global-flags-from-all-parents
Collect global flags from the full command hierarchy
2015-06-01 21:25:30 -07:00
Jesse Szwedko 7ed7a51f86 Aggregate errors from Before/After
Previously `After` would overwrite any error from `Before`.
2015-06-01 21:14:53 -07:00
Jesse Szwedko 5d58d5b313 Merge pull request #229 from saromanov/fix-missing-value
Fix panic if Valus in Int/StringSliceFlasg is missing
2015-06-01 20:39:11 -07:00
jszwedko 942282e931 Add instructions for distributing bash completion
[ci skip]
2015-05-10 11:45:54 -07:00
jszwedko a889873af5 Set additional information on command's 'app'
For completeness
2015-05-03 18:42:21 -07:00
Jesse Szwedko 4ee3fafcf8 Merge pull request #218 from codegangsta/add-another-help-test
Set writer when running command as app
2015-05-03 18:41:04 -07:00
jszwedko b8104e5da7 Set writer when running command as app
Also add test from https://github.com/codegangsta/cli/pull/202 with
slight modifications.
2015-05-03 18:37:51 -07:00
jszwedko f952f5ac6f Rename TestShowAppHelp to be more verbose
Follow golang convention
2015-05-03 18:04:45 -07:00
jszwedko 96ad929784 Add test for inclusion of 'AUTHORS' in App help 2015-05-03 18:02:03 -07:00
Jesse Szwedko 2e64a10881 Merge pull request #217 from codegangsta/readd-print-help-function
Readd printHelp function back
2015-05-03 17:52:12 -07:00
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.
2015-05-03 17:43:52 -07:00
Jesse Szwedko 30b361bf66 Merge pull request #211 from netbun/patch-1
changes to readme.md
2015-04-21 20:12:02 -07:00
Jesse Szwedko 9b2bd2b348 Merge pull request #205 from codegangsta/fix-aliases-readme
Names -> Aliases in README.md
2015-03-23 19:59:03 -07:00
jszwedko 6c6d93d451 Names -> Aliases in README.md 2015-03-23 07:55:18 -07:00
jszwedko daad50e530 Turns out I didn't mean to add ExampleAppCommands at all 2015-03-16 18:48:06 -07:00
jszwedko 474646abed Didn't mean to remove ExampleAppSubcommand
Also specify struct field initializers
2015-03-16 18:04:57 -07:00
Jesse Szwedko 55e291873b Merge pull request #200 from smallfish/patch-1
Update help.go
2015-03-16 17:52:42 -07:00
Jesse Szwedko 8ce64f19ff Merge pull request #187 from ravigadde/master
Added an API for number of flags set
2015-03-10 18:05:58 -07:00
Jesse Szwedko 012696c9b0 Merge pull request #196 from codegangsta/fix-deprecated-author-support
Fix support for deprecated author fields
2015-03-10 08:35:55 -07:00
jszwedko b95607c608 Use named struct fields 2015-03-10 08:13:31 -07:00
jszwedko 7beac44ab1 Don't default authors 2015-03-10 08:03:05 -07:00
jszwedko 5f95a9e88b Fix support for deprecated author fields
Should add an author if either name or email is specified.
2015-03-10 07:59:59 -07:00
jszwedko bf65971a6a Add Command.Aliases and deprecate Command.ShortName
`Aliases` will be more flexible while still allowing "ShortName"
behaviour via `Aliases`.
2015-03-09 21:24:57 -07:00
Jesse Szwedko 3e0905345c Merge pull request #186 from nrdufour/master
Fixing the issue with a command with subcommands not showing help message
2015-03-09 19:37:25 -07:00
Jesse Szwedko 842ff18343 Merge pull request #192 from codegangsta/add-multi-author-support
Add multi author support
2015-03-09 19:32:34 -07:00
jszwedko 01cdaa065a Merge remote-tracking branch 'origin/master' into add-multi-author-support
Conflicts:
	app.go
2015-03-09 19:20:56 -07:00
jszwedko 50c77ecec0 Fix comments for .After field on Command and App 2015-02-20 16:23:36 -05:00
Jesse Szwedko 532d0bc2e3 Merge pull request #151 from imdario/master
After: companion action for Before
2015-02-20 16:20:12 -05:00
Jesse Szwedko 6086d7927e Merge pull request #177 from vishalsodani/master
Fix sentence
2015-01-30 19:12:59 -08:00
Jesse Szwedko e1712f3817 Merge pull request #170 from codegangsta/parse-flags-regardless
Use parsed context when running command as subcommnd
2015-01-27 21:16:17 -08:00
jszwedko 5159b98cbc Use parsed context when running command as subcommnd
Rather than passing the unparsed context (parent context) in whenever
there are no subcommands.
2015-01-09 14:46:29 -05:00
Jesse Szwedko bf4a526f48 Merge pull request #157 from dajulia3/pull_request
stop flag parsing after terminator --
2015-01-09 14:04:33 -05:00
jszwedko 44d40054fa Use 0 as the base when parsing ints
To be consistent with what the stdlib flag package does.
2015-01-09 13:10:42 -05:00
Jesse Szwedko 3005aa4907 Merge pull request #168 from szaydel/fixParseUint-Flag
strconv.ParseInt should be used instead of strconv.ParseUint when readin...
2015-01-09 13:10:19 -05:00
jszwedko 059c02782a Use double quotes in output for defaults
Windows doesn't recognize 's for wrapping values. "s should work on all
systems.
2015-01-08 15:35:23 -05:00
jszwedko 22dbe6ffdc Fix help text for generic flag to not insinuate that you can specify multiple
Feels like it may have been copied from StringSliceFlag or something,
but update the output to be more consistent with other single value
flags.

Also added comments to the String and Apply functions.
2015-01-08 14:27:09 -05:00
Jesse Szwedko e7849f9239 Merge pull request #128 from nbjahan/patch-1
Fixed ShowSubcommandHelp
2014-12-11 20:37:53 -05:00
jszwedko 69b84ea804 Renaming fakeWriter to mockWriter for consistency 2014-12-10 10:33:59 -05:00
Jesse Szwedko fbda1ce02d Merge pull request #141 from meatballhat/multi-env-var
Adding support for multiple env var "cascade"
2014-12-03 16:09:45 -05:00
jszwedko e72094e6a4 Prefer fmt.Fprint* functions over io.WriteString
Less composition needed.
2014-12-01 23:57:35 -05:00
jszwedko b8c8282de5 Merge remote-tracking branch 'origin/master' into allow-writer-to-be-set
Conflicts:
	app.go
	help.go
2014-12-01 23:51:35 -05:00
jszwedko 0d4870d63e Rename Stdout -> Writer 2014-12-01 23:50:04 -05:00
jszwedko 780f839a02 Allow hiding of help flag without hiding help subcommand
By utilizing struct zero value
2014-12-01 23:21:22 -05:00
Jesse Szwedko 229729fae6 Merge pull request #150 from kytrinyx/readme-example
Clarify example in README. Fixes #149
2014-11-13 13:20:49 -05:00
Jesse Szwedko 61f43e7695 Merge pull request #147 from peterbourgon/master
Make -v, --version optional
2014-11-12 09:51:28 -05:00
Jesse Szwedko 7381bc4e62 Merge pull request #134 from Zearin/patch-1
Minor README tweaks
2014-08-27 20:51:55 -04:00
jszwedko 9e5f47524b Run go vet as part of Travis build 2014-07-14 13:48:52 -04:00
jszwedko c99454b374 Adding struct field names to examples in README
Idiomatic Go
2014-07-11 18:17:30 -04:00
jszwedko bcfb32b8b0 Updating tests to pass go vet
Mostly lack of struct field names in literals and one sprintf format
specifier mismatch.
2014-07-11 18:16:19 -04:00