Commit graph

22 commits

Author SHA1 Message Date
akutz 1169e1f351 Help Flag Shorthand & Usage Customization
This patch allows users to the value used for the help flag's
shorthand character so that when there's a global "host" flag, it can
use the "h" for its shorthand and the help flag can use "?".
Additionally, the ability to format the help flag's usage value would
also be nice for applications with different casing standards for help
output.

Users should simply set cobra.HelpFlagShorthand (defaults to "h") to the
desired shorthand value while using cobra.HelpFlagUsageFormatString to
specify a format string for the flag's usage value. The format string
accept a single substitution, the command's name.
2015-08-23 14:11:53 -05:00
bep beda1945ad Add mousetrap for Windows users
Fixes #80
2015-04-01 21:14:40 +02:00
Ahsanul Haque e1e66f7b4e Code commentary 2014-12-18 23:10:25 -05:00
spf13 b1e90a7943 Making prefix matching opt in. 2014-10-07 16:15:19 -04:00
spf13 864687ae68 Adding "OnInitialize()" method instead of directly setting a property. Now can have multiple initializers. 2014-07-11 10:57:53 -04:00
spf13 7cebca3761 Add support for an InitializeConfig method as defined on Cobra by the user 2014-06-27 15:45:51 -04:00
awilliams 2e73a96a48 Right aligns "Use" and "Additional help topics" even if they are longer than the min padding 2014-01-17 13:36:57 +01:00
spf13 62fb674a93 Organize the files a bit better 2013-09-24 12:47:29 -04:00
spf13 57fc2cb534 Support and test for custom output. 2013-09-24 12:12:32 -04:00
spf13 b0c5461629 Much improved usage message 2013-09-13 00:09:28 -04:00
spf13 8858462331 Add decent usage message 2013-09-12 10:37:35 -04:00
spf13 6067837866 Adding support for a custom output, default to stderr 2013-09-11 09:52:15 -04:00
spf13 8d87882095 Documentation & housecleaning 2013-09-11 09:52:15 -04:00
spf13 7ba2df2eff Detect and panic if command is setup as it's own child. 2013-09-10 18:28:58 -04:00
spf13 90b975fd8e Rewrote DebugFlags() function 2013-09-10 18:27:31 -04:00
spf13 061ba30a84 Create and utilize mergePersistentFlags method 2013-09-10 18:26:17 -04:00
spf13 ccbe1b2359 Adding debug flags method to a command & commander 2013-09-04 11:32:51 -04:00
spf13 c568b575aa Better testing support. Easy to reset to blank slate in tests. 2013-09-04 11:32:51 -04:00
spf13 a618569eea Better error handling 2013-09-04 11:32:36 -04:00
spf13 36e08ffd5b Parsing persistentFlags properly (mostly) 2013-09-04 00:15:18 -04:00
spf13 ce6447a965 Properly swallowing flag error messages 2013-09-03 23:28:34 -04:00
spf13 bbb8e6e199 initial commit of cobra w/test suite 2013-09-03 18:54:51 -04:00