From b7e64714a53ad4b5ee9f656aad2f61e358623d11 Mon Sep 17 00:00:00 2001 From: Alex Ogier Date: Wed, 19 Dec 2012 04:35:40 -0500 Subject: Add missing VarP function for the default command line --- flag.go | 5 +++++ 1 file changed, 5 insertions(+) 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 { -- cgit v1.2.3