Commit Graph

545 Commits

Author SHA1 Message Date
Jeremy Saenz
650665814a Merge pull request #116 from modcloth/add-go-vet-to-travis-build
Run `go vet` as part of Travis build
2014-07-15 12:28:19 -07:00
jszwedko
9e5f47524b Run go vet as part of Travis build 2014-07-14 13:48:52 -04:00
Audrius Butkevicius
449f261ee9 Add App.RunAndExitOnError shortcut 2014-07-13 18:56:43 +01:00
Audrius Butkevicius
6f8cfa703a Add Args.Swap command for swapping arguments
The usecase:
my-cli user <USERID> set <FIELD> <VALUE>

Being able to swap <USERID> with set argument, we can have nested subcommands while preserving all variable arguments along the way.
2014-07-13 18:56:02 +01:00
Audrius Butkevicius
9e036e08f1 Fix tests 2014-07-13 18:52:30 +01:00
Audrius Butkevicius
bc02933ea4 Fix Subcommand help text 2014-07-13 18:51:24 +01:00
Audrius Butkevicius
d6d4e6448b Hide "Options" sections in help, if no flags are defined 2014-07-13 18:51:17 +01:00
Audrius Butkevicius
4a645835f0 Add HideHelp flag in App and Command 2014-07-13 18:51:09 +01:00
Jeremy Saenz
d38a3b82a6 Merge pull request #109 from modcloth/go-vetting
Go vetting
2014-07-11 15:57:55 -07:00
48869e13a4 Addressing go vet offenses 2014-07-11 18:30:16 -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
fc16c67be3 Updating structs to use labels, adding tests for env stuff 2014-07-11 18:13:10 -04:00
97fd93272f Starting to hack in some env var configuration goodness 2014-07-11 13:29:56 -04:00
Jeremy Saenz
5ddbbe33e5 Merge pull request #106 from gemnasium/fix-subcmd-global-flags
Fix global flags in Subcommands
2014-07-08 07:54:03 -07:00
Philippe Lafoucrière
df5fb46048 Fix global flags in Subcommands
closes #69
2014-07-06 11:04:48 +02:00
Yushi Nakai
742745ce19 add completion file for zsh 2014-06-19 01:06:23 +09:00
Josh Mervine
8f55ca83ff running go fmt 2014-06-17 22:33:30 -07:00
Josh Mervine
7ca86444e8 making all pathing for cli local in tests for easier fork testing 2014-06-17 22:28:33 -07:00
Joshua Mervine
5821632000 Adding VersionPrinter and tests. 2014-06-17 22:26:35 -07:00
Artem Nezvigin
71e3acacd2 Add FlagNames() method to Context
It's often useful to list all defined flags prior to launching the
program for debugging/logging purposes. This takes away the boilerplate.
2014-06-13 20:10:37 -07:00
John Hopper
60e3dcaf6d Allow a writer to be set that represents Stdout so that redirection of App output may occur. 2014-06-12 02:27:15 -07:00
Jeremy Saenz
bb9189510a Merge pull request #81 from zenoss/upstream/feature/generic-flags
Generic parsers as flag types
2014-05-27 16:54:16 -07:00
Jeremy Saenz
07cae0dfd4 Merge pull request #84 from JackC/help-printer
Use HelpPrinter in ShowCommandHelp
2014-05-27 16:53:49 -07:00
Jeremy Saenz
c05720b864 Merge pull request #86 from zenoss/upstream/feature/help-version-flags
Can now change these default flags in other applications
2014-05-27 16:53:18 -07:00
Summer Mousa
a911ec75e4 Can now change these default flags in other applications 2014-04-29 09:21:19 -05:00
Jack Christensen
357921b483 Use HelpPrinter in ShowCommandHelp 2014-04-26 17:02:33 -06:00
Jeremy Saenz
820deefc90 Merge pull request #83 from penberg/string-slice-usage-text
Make StringSliceFlag usage text consistent
2014-04-22 20:39:41 -07:00
Jeremy Saenz
73aae5979c Merge pull request #80 from wendorf/master
Add SkipFlagParsing option to Command
2014-04-22 20:34:36 -07:00
Jeremy Saenz
5e1cde20d3 Merge pull request #75 from Winslett/command-not-found
Customizable command not found function
2014-04-22 20:33:49 -07:00
Jeremy Saenz
a502865bb7 Merge pull request #74 from Winslett/context-accessible-command
Make Command accessible from Context
2014-04-22 20:33:02 -07:00
Jeremy Saenz
5a05be4a93 Merge pull request #82 from zenoss/upstream/feature/recursive-subcommands
A better version of infinite subcommands
2014-04-22 20:31:10 -07:00
Summer Mousa
2535376782 If the Subcommand is instantiated, via the Before method and has no subcommands, display the CommandHelp instead of the SubcommandHelp 2014-04-17 11:48:00 -05:00
Pekka Enberg
646b290d5d Make StringSliceFlag usage text consistent
This fixes StringSliceFlag default usage text to be consistent with
IntegerSliceFlag.

Before:

   -f []	`-f option -f option` port forwarding rules

After:

   -f '-f option -f option'	port forwarding rules

Signed-off-by: Pekka Enberg <penberg@cloudius-systems.com>
2014-04-17 11:44:12 +03:00
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 2014-04-16 15:26:28 -05:00
Summer Mousa
1a63283d44 dolling it up 2014-04-16 13:10:13 -05:00
Summer Mousa
4f92d19cbb Updated readme 2014-04-16 13:09:14 -05:00
Summer Mousa
705994c2c6 Added unit tests 2014-04-16 12:59:34 -05:00
Summer Mousa
13f0c8c0f6 More consistent implementation of recursive subcommands 2014-04-16 11:18:00 -05:00
Summer Mousa
1eaa882c3a removed extranneous value method on the generic type 2014-04-15 09:57:11 -05:00
Summer Mousa
13e88629f5 Generic parsers as flag types 2014-04-15 09:16:47 -05:00
Dan Wendorf and Karen Wang
6c5f810d8f Add SkipFlagParsing option to Command 2014-04-14 14:44:32 -07:00
Jeremy Saenz
640826c88f Merge pull request #78 from zenoss/feature/bash-completion
Bash completion
2014-04-14 10:00:36 -07:00
Jeremy Saenz
07c53fda7a Merge pull request #79 from rschmukler/master
remove quotes for empty StringFlags
2014-04-14 09:59:48 -07:00
Summer Mousa
85c3eadea4 Adding sample test 2014-04-12 17:13:47 -05:00
Summer Mousa
7544c56e3c Added some documentation and bash integration code 2014-04-12 16:59:41 -05:00
Summer Mousa
3a10545f91 Made bash completion command optional; still need to update documentation 2014-04-12 08:32:53 -05:00
Ryan Schmukler
312151dca4 remove quotes for empty StringFlags 2014-04-11 15:16:09 -04:00
Summer Mousa
0b29bee364 merging code 2014-04-10 12:14:13 -05:00
Chris Winslett
37299d4e5a Customizable command not found function 2014-03-30 20:46:02 -07:00