aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAlex Ogier <[email protected]>2012-12-19 04:35:40 -0500
committerAlex Ogier <[email protected]>2012-12-19 04:35:40 -0500
commitb7e64714a53ad4b5ee9f656aad2f61e358623d11 (patch)
tree2b99f1243a65de4b59dad937cfe2b76a16f6e387
parentbc8eb13c45bf419dbf31b974e9931e5ab049cada (diff)
Add missing VarP function for the default command line
-rw-r--r--flag.go5
1 files changed, 5 insertions, 0 deletions
diff --git a/flag.go b/flag.go
index a698e27..0154001 100644
--- a/flag.go
+++ b/flag.go
@@ -883,6 +883,11 @@ func Var(value Value, name string, usage string) {
commandLine.VarP(value, name, "", usage)
}
+// Like Var, but accepts a shorthand letter that can be used after a single dash.
+func VarP(value Value, name, shorthand, usage string) {
+ commandLine.VarP(value, name, shorthand, usage)
+}
+
// failf prints to standard error a formatted error and usage message and
// returns the error.
func (f *FlagSet) failf(format string, a ...interface{}) error {