Skip to content
Projects
Groups
Snippets
Help
This project
Loading...
Sign in / Register
Toggle navigation
K
k3s
Project
Project
Details
Activity
Cycle Analytics
Repository
Repository
Files
Commits
Branches
Tags
Contributors
Graph
Compare
Charts
Issues
0
Issues
0
List
Board
Labels
Milestones
Merge Requests
0
Merge Requests
0
CI / CD
CI / CD
Pipelines
Jobs
Schedules
Charts
Registry
Registry
Wiki
Wiki
Snippets
Snippets
Members
Members
Collapse sidebar
Close sidebar
Activity
Graph
Charts
Create a new issue
Jobs
Commits
Issue Boards
Open sidebar
Jacklull
k3s
Commits
681ee126
Commit
681ee126
authored
Aug 20, 2015
by
Eric Paris
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
Update spf13/cobra and spf13/pflag
parent
2f1edf7d
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
31 changed files
with
311 additions
and
111 deletions
+311
-111
Godeps.json
Godeps/Godeps.json
+2
-3
bash_completions.go
..._workspace/src/github.com/spf13/cobra/bash_completions.go
+17
-0
bash_completions_test.go
...space/src/github.com/spf13/cobra/bash_completions_test.go
+7
-0
cobra_test.go
Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
+8
-0
command.go
Godeps/_workspace/src/github.com/spf13/cobra/command.go
+7
-1
bool.go
Godeps/_workspace/src/github.com/spf13/pflag/bool.go
+4
-4
count.go
Godeps/_workspace/src/github.com/spf13/pflag/count.go
+13
-0
duration.go
Godeps/_workspace/src/github.com/spf13/pflag/duration.go
+4
-4
flag.go
Godeps/_workspace/src/github.com/spf13/pflag/flag.go
+0
-0
flag_test.go
Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
+27
-10
float32.go
Godeps/_workspace/src/github.com/spf13/pflag/float32.go
+4
-4
float64.go
Godeps/_workspace/src/github.com/spf13/pflag/float64.go
+4
-4
golangflag.go
Godeps/_workspace/src/github.com/spf13/pflag/golangflag.go
+94
-0
golangflag_test.go
.../_workspace/src/github.com/spf13/pflag/golangflag_test.go
+39
-0
int.go
Godeps/_workspace/src/github.com/spf13/pflag/int.go
+4
-4
int32.go
Godeps/_workspace/src/github.com/spf13/pflag/int32.go
+4
-4
int64.go
Godeps/_workspace/src/github.com/spf13/pflag/int64.go
+4
-4
int8.go
Godeps/_workspace/src/github.com/spf13/pflag/int8.go
+4
-4
int_slice.go
Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
+6
-6
int_slice_test.go
...s/_workspace/src/github.com/spf13/pflag/int_slice_test.go
+7
-7
ip.go
Godeps/_workspace/src/github.com/spf13/pflag/ip.go
+4
-4
ipmask.go
Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
+5
-5
ipnet.go
Godeps/_workspace/src/github.com/spf13/pflag/ipnet.go
+11
-11
string.go
Godeps/_workspace/src/github.com/spf13/pflag/string.go
+4
-4
string_slice.go
Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
+6
-6
string_slice_test.go
...workspace/src/github.com/spf13/pflag/string_slice_test.go
+2
-2
uint.go
Godeps/_workspace/src/github.com/spf13/pflag/uint.go
+4
-4
uint16.go
Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
+4
-4
uint32.go
Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
+4
-4
uint64.go
Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
+4
-4
uint8.go
Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
+4
-4
No files found.
Godeps/Godeps.json
View file @
681ee126
...
@@ -476,12 +476,11 @@
...
@@ -476,12 +476,11 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/cobra"
,
"ImportPath"
:
"github.com/spf13/cobra"
,
"Rev"
:
"
385fc87e4343efec233811d3d933509e8975d11a
"
"Rev"
:
"
db0518444643a7b170abb78164bbeaf5a2bb816f
"
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Comment"
:
"v0.0.1-81-g4869ec2"
,
"Rev"
:
"112aaa578dfdd0e913663b05153be974bd72497a"
"Rev"
:
"4869ec2ae0628354eaac5bf88fccf9a7265ae475"
},
},
{
{
"ImportPath"
:
"github.com/stretchr/objx"
,
"ImportPath"
:
"github.com/stretchr/objx"
,
...
...
Godeps/_workspace/src/github.com/spf13/cobra/bash_completions.go
View file @
681ee126
...
@@ -13,6 +13,7 @@ import (
...
@@ -13,6 +13,7 @@ import (
const
(
const
(
BashCompFilenameExt
=
"cobra_annotation_bash_completion_filename_extentions"
BashCompFilenameExt
=
"cobra_annotation_bash_completion_filename_extentions"
BashCompOneRequiredFlag
=
"cobra_annotation_bash_completion_one_required_flag"
BashCompOneRequiredFlag
=
"cobra_annotation_bash_completion_one_required_flag"
BashCompSubdirsInDir
=
"cobra_annotation_bash_completion_subdirs_in_dir"
)
)
func
preamble
(
out
*
bytes
.
Buffer
)
{
func
preamble
(
out
*
bytes
.
Buffer
)
{
...
@@ -100,6 +101,12 @@ __handle_filename_extension_flag()
...
@@ -100,6 +101,12 @@ __handle_filename_extension_flag()
_filedir "@(${ext})"
_filedir "@(${ext})"
}
}
__handle_subdirs_in_dir_flag()
{
local dir="$1"
pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
}
__handle_flag()
__handle_flag()
{
{
__debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
__debug "${FUNCNAME}: c is $c words[c] is ${words[c]}"
...
@@ -226,6 +233,16 @@ func writeFlagHandler(name string, annotations map[string][]string, out *bytes.B
...
@@ -226,6 +233,16 @@ func writeFlagHandler(name string, annotations map[string][]string, out *bytes.B
ext
:=
"_filedir"
ext
:=
"_filedir"
fmt
.
Fprintf
(
out
,
" flags_completion+=(%q)
\n
"
,
ext
)
fmt
.
Fprintf
(
out
,
" flags_completion+=(%q)
\n
"
,
ext
)
}
}
case
BashCompSubdirsInDir
:
fmt
.
Fprintf
(
out
,
" flags_with_completion+=(%q)
\n
"
,
name
)
if
len
(
value
)
==
1
{
ext
:=
"__handle_subdirs_in_dir_flag "
+
value
[
0
]
fmt
.
Fprintf
(
out
,
" flags_completion+=(%q)
\n
"
,
ext
)
}
else
{
ext
:=
"_filedir -d"
fmt
.
Fprintf
(
out
,
" flags_completion+=(%q)
\n
"
,
ext
)
}
}
}
}
}
}
}
...
...
Godeps/_workspace/src/github.com/spf13/cobra/bash_completions_test.go
View file @
681ee126
...
@@ -56,6 +56,11 @@ func TestBashCompletions(t *testing.T) {
...
@@ -56,6 +56,11 @@ func TestBashCompletions(t *testing.T) {
c
.
Flags
()
.
StringVar
(
&
flagvalExt
,
"filename-ext"
,
""
,
"Enter a filename (extension limited)"
)
c
.
Flags
()
.
StringVar
(
&
flagvalExt
,
"filename-ext"
,
""
,
"Enter a filename (extension limited)"
)
c
.
MarkFlagFilename
(
"filename-ext"
)
c
.
MarkFlagFilename
(
"filename-ext"
)
// subdirectories in a given directory
var
flagvalTheme
string
c
.
Flags
()
.
StringVar
(
&
flagvalTheme
,
"theme"
,
""
,
"theme to use (located in /themes/THEMENAME/)"
)
c
.
Flags
()
.
SetAnnotation
(
"theme"
,
BashCompSubdirsInDir
,
[]
string
{
"themes"
})
out
:=
new
(
bytes
.
Buffer
)
out
:=
new
(
bytes
.
Buffer
)
c
.
GenBashCompletion
(
out
)
c
.
GenBashCompletion
(
out
)
str
:=
out
.
String
()
str
:=
out
.
String
()
...
@@ -75,6 +80,8 @@ func TestBashCompletions(t *testing.T) {
...
@@ -75,6 +80,8 @@ func TestBashCompletions(t *testing.T) {
check
(
t
,
str
,
`flags_completion+=("_filedir")`
)
check
(
t
,
str
,
`flags_completion+=("_filedir")`
)
// check for filename extension flags
// check for filename extension flags
check
(
t
,
str
,
`flags_completion+=("__handle_filename_extension_flag json|yaml|yml")`
)
check
(
t
,
str
,
`flags_completion+=("__handle_filename_extension_flag json|yaml|yml")`
)
// check for subdirs_in_dir flags
check
(
t
,
str
,
`flags_completion+=("__handle_subdirs_in_dir_flag themes")`
)
checkOmit
(
t
,
str
,
cmdDeprecated
.
Name
())
checkOmit
(
t
,
str
,
cmdDeprecated
.
Name
())
}
}
Godeps/_workspace/src/github.com/spf13/cobra/cobra_test.go
View file @
681ee126
...
@@ -963,3 +963,11 @@ func TestGlobalNormFuncPropagation(t *testing.T) {
...
@@ -963,3 +963,11 @@ func TestGlobalNormFuncPropagation(t *testing.T) {
t
.
Error
(
"cmdPrint and cmdEchoSub should had the normalization function of rootCmd"
)
t
.
Error
(
"cmdPrint and cmdEchoSub should had the normalization function of rootCmd"
)
}
}
}
}
func
TestFlagOnPflagCommandLine
(
t
*
testing
.
T
)
{
flagName
:=
"flagOnCommandLine"
pflag
.
CommandLine
.
String
(
flagName
,
""
,
"about my flag"
)
r
:=
fullSetupTest
(
"--help"
)
checkResultContains
(
t
,
r
,
flagName
)
}
Godeps/_workspace/src/github.com/spf13/cobra/command.go
View file @
681ee126
...
@@ -158,7 +158,6 @@ func (c *Command) SetHelpTemplate(s string) {
...
@@ -158,7 +158,6 @@ func (c *Command) SetHelpTemplate(s string) {
func
(
c
*
Command
)
SetGlobalNormalizationFunc
(
n
func
(
f
*
flag
.
FlagSet
,
name
string
)
flag
.
NormalizedName
)
{
func
(
c
*
Command
)
SetGlobalNormalizationFunc
(
n
func
(
f
*
flag
.
FlagSet
,
name
string
)
flag
.
NormalizedName
)
{
c
.
Flags
()
.
SetNormalizeFunc
(
n
)
c
.
Flags
()
.
SetNormalizeFunc
(
n
)
c
.
PersistentFlags
()
.
SetNormalizeFunc
(
n
)
c
.
PersistentFlags
()
.
SetNormalizeFunc
(
n
)
c
.
LocalFlags
()
.
SetNormalizeFunc
(
n
)
c
.
globNormFunc
=
n
c
.
globNormFunc
=
n
for
_
,
command
:=
range
c
.
commands
{
for
_
,
command
:=
range
c
.
commands
{
...
@@ -873,6 +872,13 @@ func (c *Command) LocalFlags() *flag.FlagSet {
...
@@ -873,6 +872,13 @@ func (c *Command) LocalFlags() *flag.FlagSet {
c
.
lflags
.
VisitAll
(
func
(
f
*
flag
.
Flag
)
{
c
.
lflags
.
VisitAll
(
func
(
f
*
flag
.
Flag
)
{
local
.
AddFlag
(
f
)
local
.
AddFlag
(
f
)
})
})
if
!
c
.
HasParent
()
{
flag
.
CommandLine
.
VisitAll
(
func
(
f
*
flag
.
Flag
)
{
if
local
.
Lookup
(
f
.
Name
)
==
nil
{
local
.
AddFlag
(
f
)
}
})
}
return
local
return
local
}
}
...
...
Godeps/_workspace/src/github.com/spf13/pflag/bool.go
View file @
681ee126
...
@@ -53,7 +53,7 @@ func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
...
@@ -53,7 +53,7 @@ func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
f
.
BoolVarP
(
p
,
name
,
""
,
value
,
usage
)
f
.
BoolVarP
(
p
,
name
,
""
,
value
,
usage
)
}
}
//
L
ike BoolVar, but accepts a shorthand letter that can be used after a single dash.
//
BoolVarP is l
ike BoolVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
BoolVarP
(
p
*
bool
,
name
,
shorthand
string
,
value
bool
,
usage
string
)
{
func
(
f
*
FlagSet
)
BoolVarP
(
p
*
bool
,
name
,
shorthand
string
,
value
bool
,
usage
string
)
{
flag
:=
f
.
VarPF
(
newBoolValue
(
value
,
p
),
name
,
shorthand
,
usage
)
flag
:=
f
.
VarPF
(
newBoolValue
(
value
,
p
),
name
,
shorthand
,
usage
)
flag
.
NoOptDefVal
=
"true"
flag
.
NoOptDefVal
=
"true"
...
@@ -65,7 +65,7 @@ func BoolVar(p *bool, name string, value bool, usage string) {
...
@@ -65,7 +65,7 @@ func BoolVar(p *bool, name string, value bool, usage string) {
BoolVarP
(
p
,
name
,
""
,
value
,
usage
)
BoolVarP
(
p
,
name
,
""
,
value
,
usage
)
}
}
//
L
ike BoolVar, but accepts a shorthand letter that can be used after a single dash.
//
BoolVarP is l
ike BoolVar, but accepts a shorthand letter that can be used after a single dash.
func
BoolVarP
(
p
*
bool
,
name
,
shorthand
string
,
value
bool
,
usage
string
)
{
func
BoolVarP
(
p
*
bool
,
name
,
shorthand
string
,
value
bool
,
usage
string
)
{
flag
:=
CommandLine
.
VarPF
(
newBoolValue
(
value
,
p
),
name
,
shorthand
,
usage
)
flag
:=
CommandLine
.
VarPF
(
newBoolValue
(
value
,
p
),
name
,
shorthand
,
usage
)
flag
.
NoOptDefVal
=
"true"
flag
.
NoOptDefVal
=
"true"
...
@@ -77,7 +77,7 @@ func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
...
@@ -77,7 +77,7 @@ func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
return
f
.
BoolP
(
name
,
""
,
value
,
usage
)
return
f
.
BoolP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Bool, but accepts a shorthand letter that can be used after a single dash.
//
BoolP is l
ike Bool, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
BoolP
(
name
,
shorthand
string
,
value
bool
,
usage
string
)
*
bool
{
func
(
f
*
FlagSet
)
BoolP
(
name
,
shorthand
string
,
value
bool
,
usage
string
)
*
bool
{
p
:=
new
(
bool
)
p
:=
new
(
bool
)
f
.
BoolVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
BoolVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -90,7 +90,7 @@ func Bool(name string, value bool, usage string) *bool {
...
@@ -90,7 +90,7 @@ func Bool(name string, value bool, usage string) *bool {
return
BoolP
(
name
,
""
,
value
,
usage
)
return
BoolP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Bool, but accepts a shorthand letter that can be used after a single dash.
//
BoolP is l
ike Bool, but accepts a shorthand letter that can be used after a single dash.
func
BoolP
(
name
,
shorthand
string
,
value
bool
,
usage
string
)
*
bool
{
func
BoolP
(
name
,
shorthand
string
,
value
bool
,
usage
string
)
*
bool
{
b
:=
CommandLine
.
BoolP
(
name
,
shorthand
,
value
,
usage
)
b
:=
CommandLine
.
BoolP
(
name
,
shorthand
,
value
,
usage
)
return
b
return
b
...
...
Godeps/_workspace/src/github.com/spf13/pflag/count.go
View file @
681ee126
...
@@ -38,6 +38,7 @@ func countConv(sval string) (interface{}, error) {
...
@@ -38,6 +38,7 @@ func countConv(sval string) (interface{}, error) {
return
i
,
nil
return
i
,
nil
}
}
// GetCount return the int value of a flag with the given name
func
(
f
*
FlagSet
)
GetCount
(
name
string
)
(
int
,
error
)
{
func
(
f
*
FlagSet
)
GetCount
(
name
string
)
(
int
,
error
)
{
val
,
err
:=
f
.
getFlagType
(
name
,
"count"
,
countConv
)
val
,
err
:=
f
.
getFlagType
(
name
,
"count"
,
countConv
)
if
err
!=
nil
{
if
err
!=
nil
{
...
@@ -46,39 +47,51 @@ func (f *FlagSet) GetCount(name string) (int, error) {
...
@@ -46,39 +47,51 @@ func (f *FlagSet) GetCount(name string) (int, error) {
return
val
.
(
int
),
nil
return
val
.
(
int
),
nil
}
}
// CountVar defines a count flag with specified name, default value, and usage string.
// The argument p points to an int variable in which to store the value of the flag.
// A count flag will add 1 to its value evey time it is found on the command line
func
(
f
*
FlagSet
)
CountVar
(
p
*
int
,
name
string
,
usage
string
)
{
func
(
f
*
FlagSet
)
CountVar
(
p
*
int
,
name
string
,
usage
string
)
{
f
.
CountVarP
(
p
,
name
,
""
,
usage
)
f
.
CountVarP
(
p
,
name
,
""
,
usage
)
}
}
// CountVarP is like CountVar only take a shorthand for the flag name.
func
(
f
*
FlagSet
)
CountVarP
(
p
*
int
,
name
,
shorthand
string
,
usage
string
)
{
func
(
f
*
FlagSet
)
CountVarP
(
p
*
int
,
name
,
shorthand
string
,
usage
string
)
{
flag
:=
f
.
VarPF
(
newCountValue
(
0
,
p
),
name
,
shorthand
,
usage
)
flag
:=
f
.
VarPF
(
newCountValue
(
0
,
p
),
name
,
shorthand
,
usage
)
flag
.
NoOptDefVal
=
"-1"
flag
.
NoOptDefVal
=
"-1"
}
}
// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set
func
CountVar
(
p
*
int
,
name
string
,
usage
string
)
{
func
CountVar
(
p
*
int
,
name
string
,
usage
string
)
{
CommandLine
.
CountVar
(
p
,
name
,
usage
)
CommandLine
.
CountVar
(
p
,
name
,
usage
)
}
}
// CountVarP is like CountVar only take a shorthand for the flag name.
func
CountVarP
(
p
*
int
,
name
,
shorthand
string
,
usage
string
)
{
func
CountVarP
(
p
*
int
,
name
,
shorthand
string
,
usage
string
)
{
CommandLine
.
CountVarP
(
p
,
name
,
shorthand
,
usage
)
CommandLine
.
CountVarP
(
p
,
name
,
shorthand
,
usage
)
}
}
// Count defines a count flag with specified name, default value, and usage string.
// The return value is the address of an int variable that stores the value of the flag.
// A count flag will add 1 to its value evey time it is found on the command line
func
(
f
*
FlagSet
)
Count
(
name
string
,
usage
string
)
*
int
{
func
(
f
*
FlagSet
)
Count
(
name
string
,
usage
string
)
*
int
{
p
:=
new
(
int
)
p
:=
new
(
int
)
f
.
CountVarP
(
p
,
name
,
""
,
usage
)
f
.
CountVarP
(
p
,
name
,
""
,
usage
)
return
p
return
p
}
}
// CountP is like Count only takes a shorthand for the flag name.
func
(
f
*
FlagSet
)
CountP
(
name
,
shorthand
string
,
usage
string
)
*
int
{
func
(
f
*
FlagSet
)
CountP
(
name
,
shorthand
string
,
usage
string
)
*
int
{
p
:=
new
(
int
)
p
:=
new
(
int
)
f
.
CountVarP
(
p
,
name
,
shorthand
,
usage
)
f
.
CountVarP
(
p
,
name
,
shorthand
,
usage
)
return
p
return
p
}
}
// Count like Count only the flag is placed on the CommandLine isntead of a given flag set
func
Count
(
name
string
,
usage
string
)
*
int
{
func
Count
(
name
string
,
usage
string
)
*
int
{
return
CommandLine
.
CountP
(
name
,
""
,
usage
)
return
CommandLine
.
CountP
(
name
,
""
,
usage
)
}
}
// CountP is like Count only takes a shorthand for the flag name.
func
CountP
(
name
,
shorthand
string
,
usage
string
)
*
int
{
func
CountP
(
name
,
shorthand
string
,
usage
string
)
*
int
{
return
CommandLine
.
CountP
(
name
,
shorthand
,
usage
)
return
CommandLine
.
CountP
(
name
,
shorthand
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/duration.go
View file @
681ee126
...
@@ -43,7 +43,7 @@ func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration
...
@@ -43,7 +43,7 @@ func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration
f
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike DurationVar, but accepts a shorthand letter that can be used after a single dash.
//
DurationVarP is l
ike DurationVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
DurationVarP
(
p
*
time
.
Duration
,
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
{
func
(
f
*
FlagSet
)
DurationVarP
(
p
*
time
.
Duration
,
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
{
f
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -54,7 +54,7 @@ func DurationVar(p *time.Duration, name string, value time.Duration, usage strin
...
@@ -54,7 +54,7 @@ func DurationVar(p *time.Duration, name string, value time.Duration, usage strin
CommandLine
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike DurationVar, but accepts a shorthand letter that can be used after a single dash.
//
DurationVarP is l
ike DurationVar, but accepts a shorthand letter that can be used after a single dash.
func
DurationVarP
(
p
*
time
.
Duration
,
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
{
func
DurationVarP
(
p
*
time
.
Duration
,
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
{
CommandLine
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newDurationValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -67,7 +67,7 @@ func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time
...
@@ -67,7 +67,7 @@ func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time
return
p
return
p
}
}
//
L
ike Duration, but accepts a shorthand letter that can be used after a single dash.
//
DurationP is l
ike Duration, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
DurationP
(
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
*
time
.
Duration
{
func
(
f
*
FlagSet
)
DurationP
(
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
*
time
.
Duration
{
p
:=
new
(
time
.
Duration
)
p
:=
new
(
time
.
Duration
)
f
.
DurationVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
DurationVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -80,7 +80,7 @@ func Duration(name string, value time.Duration, usage string) *time.Duration {
...
@@ -80,7 +80,7 @@ func Duration(name string, value time.Duration, usage string) *time.Duration {
return
CommandLine
.
DurationP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
DurationP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Duration, but accepts a shorthand letter that can be used after a single dash.
//
DurationP is l
ike Duration, but accepts a shorthand letter that can be used after a single dash.
func
DurationP
(
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
*
time
.
Duration
{
func
DurationP
(
name
,
shorthand
string
,
value
time
.
Duration
,
usage
string
)
*
time
.
Duration
{
return
CommandLine
.
DurationP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
DurationP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/flag.go
View file @
681ee126
This diff is collapsed.
Click to expand it.
Godeps/_workspace/src/github.com/spf13/pflag/flag_test.go
View file @
681ee126
...
@@ -19,15 +19,15 @@ import (
...
@@ -19,15 +19,15 @@ import (
)
)
var
(
var
(
test
_bool
=
Bool
(
"test_bool"
,
false
,
"bool value"
)
test
Bool
=
Bool
(
"test_bool"
,
false
,
"bool value"
)
test
_int
=
Int
(
"test_int"
,
0
,
"int value"
)
test
Int
=
Int
(
"test_int"
,
0
,
"int value"
)
test
_int64
=
Int64
(
"test_int64"
,
0
,
"int64 value"
)
test
Int64
=
Int64
(
"test_int64"
,
0
,
"int64 value"
)
test
_uint
=
Uint
(
"test_uint"
,
0
,
"uint value"
)
test
Uint
=
Uint
(
"test_uint"
,
0
,
"uint value"
)
test
_uint64
=
Uint64
(
"test_uint64"
,
0
,
"uint64 value"
)
test
Uint64
=
Uint64
(
"test_uint64"
,
0
,
"uint64 value"
)
test
_string
=
String
(
"test_string"
,
"0"
,
"string value"
)
test
String
=
String
(
"test_string"
,
"0"
,
"string value"
)
test
_float64
=
Float64
(
"test_float64"
,
0
,
"float64 value"
)
test
Float
=
Float64
(
"test_float64"
,
0
,
"float64 value"
)
test
_duration
=
Duration
(
"test_duration"
,
0
,
"time.Duration value"
)
test
Duration
=
Duration
(
"test_duration"
,
0
,
"time.Duration value"
)
test
_optional_int
=
Int
(
"test_optional_int"
,
0
,
"optional int value"
)
test
OptionalInt
=
Int
(
"test_optional_int"
,
0
,
"optional int value"
)
normalizeFlagNameInvocations
=
0
normalizeFlagNameInvocations
=
0
)
)
...
@@ -110,6 +110,23 @@ func TestUsage(t *testing.T) {
...
@@ -110,6 +110,23 @@ func TestUsage(t *testing.T) {
}
}
}
}
func
TestAddFlagSet
(
t
*
testing
.
T
)
{
oldSet
:=
NewFlagSet
(
"old"
,
ContinueOnError
)
newSet
:=
NewFlagSet
(
"new"
,
ContinueOnError
)
oldSet
.
String
(
"flag1"
,
"flag1"
,
"flag1"
)
oldSet
.
String
(
"flag2"
,
"flag2"
,
"flag2"
)
newSet
.
String
(
"flag2"
,
"flag2"
,
"flag2"
)
newSet
.
String
(
"flag3"
,
"flag3"
,
"flag3"
)
oldSet
.
AddFlagSet
(
newSet
)
if
len
(
oldSet
.
formal
)
!=
3
{
t
.
Errorf
(
"Unexpected result adding a FlagSet to a FlagSet %v"
,
oldSet
)
}
}
func
TestAnnotation
(
t
*
testing
.
T
)
{
func
TestAnnotation
(
t
*
testing
.
T
)
{
f
:=
NewFlagSet
(
"shorthand"
,
ContinueOnError
)
f
:=
NewFlagSet
(
"shorthand"
,
ContinueOnError
)
...
@@ -291,7 +308,7 @@ func testParse(f *FlagSet, t *testing.T) {
...
@@ -291,7 +308,7 @@ func testParse(f *FlagSet, t *testing.T) {
t
.
Error
(
"mask flag should be 255.255.255.0, is "
,
(
*
maskFlag
)
.
String
())
t
.
Error
(
"mask flag should be 255.255.255.0, is "
,
(
*
maskFlag
)
.
String
())
}
}
if
v
,
err
:=
f
.
GetIPv4Mask
(
"mask"
);
err
!=
nil
||
v
.
String
()
!=
(
*
maskFlag
)
.
String
()
{
if
v
,
err
:=
f
.
GetIPv4Mask
(
"mask"
);
err
!=
nil
||
v
.
String
()
!=
(
*
maskFlag
)
.
String
()
{
t
.
Errorf
(
"GetIP returned %v
but maskFlag
was %v"
,
v
,
*
maskFlag
,
err
)
t
.
Errorf
(
"GetIP returned %v
maskFlag was %v error
was %v"
,
v
,
*
maskFlag
,
err
)
}
}
if
*
durationFlag
!=
2
*
time
.
Minute
{
if
*
durationFlag
!=
2
*
time
.
Minute
{
t
.
Error
(
"duration flag should be 2m, is "
,
*
durationFlag
)
t
.
Error
(
"duration flag should be 2m, is "
,
*
durationFlag
)
...
...
Godeps/_workspace/src/github.com/spf13/pflag/float32.go
View file @
681ee126
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage strin
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage strin
f
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Float32Var, but accepts a shorthand letter that can be used after a single dash.
//
Float32VarP is l
ike Float32Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Float32VarP
(
p
*
float32
,
name
,
shorthand
string
,
value
float32
,
usage
string
)
{
func
(
f
*
FlagSet
)
Float32VarP
(
p
*
float32
,
name
,
shorthand
string
,
value
float32
,
usage
string
)
{
f
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -59,7 +59,7 @@ func Float32Var(p *float32, name string, value float32, usage string) {
...
@@ -59,7 +59,7 @@ func Float32Var(p *float32, name string, value float32, usage string) {
CommandLine
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Float32Var, but accepts a shorthand letter that can be used after a single dash.
//
Float32VarP is l
ike Float32Var, but accepts a shorthand letter that can be used after a single dash.
func
Float32VarP
(
p
*
float32
,
name
,
shorthand
string
,
value
float32
,
usage
string
)
{
func
Float32VarP
(
p
*
float32
,
name
,
shorthand
string
,
value
float32
,
usage
string
)
{
CommandLine
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newFloat32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
return
p
return
p
}
}
//
L
ike Float32, but accepts a shorthand letter that can be used after a single dash.
//
Float32P is l
ike Float32, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Float32P
(
name
,
shorthand
string
,
value
float32
,
usage
string
)
*
float32
{
func
(
f
*
FlagSet
)
Float32P
(
name
,
shorthand
string
,
value
float32
,
usage
string
)
*
float32
{
p
:=
new
(
float32
)
p
:=
new
(
float32
)
f
.
Float32VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Float32VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -85,7 +85,7 @@ func Float32(name string, value float32, usage string) *float32 {
...
@@ -85,7 +85,7 @@ func Float32(name string, value float32, usage string) *float32 {
return
CommandLine
.
Float32P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Float32P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Float32, but accepts a shorthand letter that can be used after a single dash.
//
Float32P is l
ike Float32, but accepts a shorthand letter that can be used after a single dash.
func
Float32P
(
name
,
shorthand
string
,
value
float32
,
usage
string
)
*
float32
{
func
Float32P
(
name
,
shorthand
string
,
value
float32
,
usage
string
)
*
float32
{
return
CommandLine
.
Float32P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Float32P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/float64.go
View file @
681ee126
...
@@ -44,7 +44,7 @@ func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage strin
...
@@ -44,7 +44,7 @@ func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage strin
f
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Float64Var, but accepts a shorthand letter that can be used after a single dash.
//
Float64VarP is l
ike Float64Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Float64VarP
(
p
*
float64
,
name
,
shorthand
string
,
value
float64
,
usage
string
)
{
func
(
f
*
FlagSet
)
Float64VarP
(
p
*
float64
,
name
,
shorthand
string
,
value
float64
,
usage
string
)
{
f
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -55,7 +55,7 @@ func Float64Var(p *float64, name string, value float64, usage string) {
...
@@ -55,7 +55,7 @@ func Float64Var(p *float64, name string, value float64, usage string) {
CommandLine
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Float64Var, but accepts a shorthand letter that can be used after a single dash.
//
Float64VarP is l
ike Float64Var, but accepts a shorthand letter that can be used after a single dash.
func
Float64VarP
(
p
*
float64
,
name
,
shorthand
string
,
value
float64
,
usage
string
)
{
func
Float64VarP
(
p
*
float64
,
name
,
shorthand
string
,
value
float64
,
usage
string
)
{
CommandLine
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newFloat64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -68,7 +68,7 @@ func (f *FlagSet) Float64(name string, value float64, usage string) *float64 {
...
@@ -68,7 +68,7 @@ func (f *FlagSet) Float64(name string, value float64, usage string) *float64 {
return
p
return
p
}
}
//
L
ike Float64, but accepts a shorthand letter that can be used after a single dash.
//
Float64P is l
ike Float64, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Float64P
(
name
,
shorthand
string
,
value
float64
,
usage
string
)
*
float64
{
func
(
f
*
FlagSet
)
Float64P
(
name
,
shorthand
string
,
value
float64
,
usage
string
)
*
float64
{
p
:=
new
(
float64
)
p
:=
new
(
float64
)
f
.
Float64VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Float64VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -81,7 +81,7 @@ func Float64(name string, value float64, usage string) *float64 {
...
@@ -81,7 +81,7 @@ func Float64(name string, value float64, usage string) *float64 {
return
CommandLine
.
Float64P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Float64P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Float64, but accepts a shorthand letter that can be used after a single dash.
//
Float64P is l
ike Float64, but accepts a shorthand letter that can be used after a single dash.
func
Float64P
(
name
,
shorthand
string
,
value
float64
,
usage
string
)
*
float64
{
func
Float64P
(
name
,
shorthand
string
,
value
float64
,
usage
string
)
*
float64
{
return
CommandLine
.
Float64P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Float64P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/golangflag.go
0 → 100644
View file @
681ee126
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
pflag
import
(
goflag
"flag"
"fmt"
"reflect"
"strings"
)
var
_
=
fmt
.
Print
// flagValueWrapper implements pflag.Value around a flag.Value. The main
// difference here is the addition of the Type method that returns a string
// name of the type. As this is generally unknown, we approximate that with
// reflection.
type
flagValueWrapper
struct
{
inner
goflag
.
Value
flagType
string
}
// We are just copying the boolFlag interface out of goflag as that is what
// they use to decide if a flag should get "true" when no arg is given.
type
goBoolFlag
interface
{
goflag
.
Value
IsBoolFlag
()
bool
}
func
wrapFlagValue
(
v
goflag
.
Value
)
Value
{
// If the flag.Value happens to also be a pflag.Value, just use it directly.
if
pv
,
ok
:=
v
.
(
Value
);
ok
{
return
pv
}
pv
:=
&
flagValueWrapper
{
inner
:
v
,
}
t
:=
reflect
.
TypeOf
(
v
)
if
t
.
Kind
()
==
reflect
.
Interface
||
t
.
Kind
()
==
reflect
.
Ptr
{
t
=
t
.
Elem
()
}
pv
.
flagType
=
strings
.
TrimSuffix
(
t
.
Name
(),
"Value"
)
return
pv
}
func
(
v
*
flagValueWrapper
)
String
()
string
{
return
v
.
inner
.
String
()
}
func
(
v
*
flagValueWrapper
)
Set
(
s
string
)
error
{
return
v
.
inner
.
Set
(
s
)
}
func
(
v
*
flagValueWrapper
)
Type
()
string
{
return
v
.
flagType
}
func
PFlagFromGoFlag
(
goflag
*
goflag
.
Flag
)
*
Flag
{
// Remember the default value as a string; it won't change.
flag
:=
&
Flag
{
Name
:
goflag
.
Name
,
Usage
:
goflag
.
Usage
,
Value
:
wrapFlagValue
(
goflag
.
Value
),
// Looks like golang flags don't set DefValue correctly :-(
//DefValue: goflag.DefValue,
DefValue
:
goflag
.
Value
.
String
(),
}
if
fv
,
ok
:=
goflag
.
Value
.
(
goBoolFlag
);
ok
&&
fv
.
IsBoolFlag
()
{
flag
.
NoOptDefVal
=
"true"
}
return
flag
}
func
(
f
*
FlagSet
)
AddGoFlag
(
goflag
*
goflag
.
Flag
)
{
if
f
.
Lookup
(
goflag
.
Name
)
!=
nil
{
return
}
newflag
:=
PFlagFromGoFlag
(
goflag
)
f
.
AddFlag
(
newflag
)
}
func
(
f
*
FlagSet
)
AddGoFlagSet
(
newSet
*
goflag
.
FlagSet
)
{
if
newSet
==
nil
{
return
}
newSet
.
VisitAll
(
func
(
goflag
*
goflag
.
Flag
)
{
f
.
AddGoFlag
(
goflag
)
})
}
Godeps/_workspace/src/github.com/spf13/pflag/golangflag_test.go
0 → 100644
View file @
681ee126
// Copyright 2009 The Go Authors. All rights reserved.
// Use of this source code is governed by a BSD-style
// license that can be found in the LICENSE file.
package
pflag
import
(
goflag
"flag"
"testing"
)
func
TestGoflags
(
t
*
testing
.
T
)
{
goflag
.
String
(
"stringFlag"
,
"stringFlag"
,
"stringFlag"
)
goflag
.
Bool
(
"boolFlag"
,
false
,
"boolFlag"
)
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
.
AddGoFlagSet
(
goflag
.
CommandLine
)
err
:=
f
.
Parse
([]
string
{
"--stringFlag=bob"
,
"--boolFlag"
})
if
err
!=
nil
{
t
.
Fatal
(
"expected no error; get"
,
err
)
}
getString
,
err
:=
f
.
GetString
(
"stringFlag"
)
if
err
!=
nil
{
t
.
Fatal
(
"expected no error; get"
,
err
)
}
if
getString
!=
"bob"
{
t
.
Fatalf
(
"expected getString=bob but got getString=%s"
,
getString
)
}
getBool
,
err
:=
f
.
GetBool
(
"boolFlag"
)
if
err
!=
nil
{
t
.
Fatal
(
"expected no error; get"
,
err
)
}
if
getBool
!=
true
{
t
.
Fatalf
(
"expected getBool=true but got getBool=%v"
,
getBool
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/int.go
View file @
681ee126
...
@@ -44,7 +44,7 @@ func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
...
@@ -44,7 +44,7 @@ func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
f
.
VarP
(
newIntValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newIntValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IntVar, but accepts a shorthand letter that can be used after a single dash.
//
IntVarP is l
ike IntVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IntVarP
(
p
*
int
,
name
,
shorthand
string
,
value
int
,
usage
string
)
{
func
(
f
*
FlagSet
)
IntVarP
(
p
*
int
,
name
,
shorthand
string
,
value
int
,
usage
string
)
{
f
.
VarP
(
newIntValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newIntValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -55,7 +55,7 @@ func IntVar(p *int, name string, value int, usage string) {
...
@@ -55,7 +55,7 @@ func IntVar(p *int, name string, value int, usage string) {
CommandLine
.
VarP
(
newIntValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newIntValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IntVar, but accepts a shorthand letter that can be used after a single dash.
//
IntVarP is l
ike IntVar, but accepts a shorthand letter that can be used after a single dash.
func
IntVarP
(
p
*
int
,
name
,
shorthand
string
,
value
int
,
usage
string
)
{
func
IntVarP
(
p
*
int
,
name
,
shorthand
string
,
value
int
,
usage
string
)
{
CommandLine
.
VarP
(
newIntValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newIntValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -68,7 +68,7 @@ func (f *FlagSet) Int(name string, value int, usage string) *int {
...
@@ -68,7 +68,7 @@ func (f *FlagSet) Int(name string, value int, usage string) *int {
return
p
return
p
}
}
//
L
ike Int, but accepts a shorthand letter that can be used after a single dash.
//
IntP is l
ike Int, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IntP
(
name
,
shorthand
string
,
value
int
,
usage
string
)
*
int
{
func
(
f
*
FlagSet
)
IntP
(
name
,
shorthand
string
,
value
int
,
usage
string
)
*
int
{
p
:=
new
(
int
)
p
:=
new
(
int
)
f
.
IntVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
IntVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -81,7 +81,7 @@ func Int(name string, value int, usage string) *int {
...
@@ -81,7 +81,7 @@ func Int(name string, value int, usage string) *int {
return
CommandLine
.
IntP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
IntP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Int, but accepts a shorthand letter that can be used after a single dash.
//
IntP is l
ike Int, but accepts a shorthand letter that can be used after a single dash.
func
IntP
(
name
,
shorthand
string
,
value
int
,
usage
string
)
*
int
{
func
IntP
(
name
,
shorthand
string
,
value
int
,
usage
string
)
*
int
{
return
CommandLine
.
IntP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
IntP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/int32.go
View file @
681ee126
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {
f
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Int32Var, but accepts a shorthand letter that can be used after a single dash.
//
Int32VarP is l
ike Int32Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int32VarP
(
p
*
int32
,
name
,
shorthand
string
,
value
int32
,
usage
string
)
{
func
(
f
*
FlagSet
)
Int32VarP
(
p
*
int32
,
name
,
shorthand
string
,
value
int32
,
usage
string
)
{
f
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -59,7 +59,7 @@ func Int32Var(p *int32, name string, value int32, usage string) {
...
@@ -59,7 +59,7 @@ func Int32Var(p *int32, name string, value int32, usage string) {
CommandLine
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Int32Var, but accepts a shorthand letter that can be used after a single dash.
//
Int32VarP is l
ike Int32Var, but accepts a shorthand letter that can be used after a single dash.
func
Int32VarP
(
p
*
int32
,
name
,
shorthand
string
,
value
int32
,
usage
string
)
{
func
Int32VarP
(
p
*
int32
,
name
,
shorthand
string
,
value
int32
,
usage
string
)
{
CommandLine
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newInt32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
return
p
return
p
}
}
//
L
ike Int32, but accepts a shorthand letter that can be used after a single dash.
//
Int32P is l
ike Int32, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int32P
(
name
,
shorthand
string
,
value
int32
,
usage
string
)
*
int32
{
func
(
f
*
FlagSet
)
Int32P
(
name
,
shorthand
string
,
value
int32
,
usage
string
)
*
int32
{
p
:=
new
(
int32
)
p
:=
new
(
int32
)
f
.
Int32VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Int32VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -85,7 +85,7 @@ func Int32(name string, value int32, usage string) *int32 {
...
@@ -85,7 +85,7 @@ func Int32(name string, value int32, usage string) *int32 {
return
CommandLine
.
Int32P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Int32P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Int32, but accepts a shorthand letter that can be used after a single dash.
//
Int32P is l
ike Int32, but accepts a shorthand letter that can be used after a single dash.
func
Int32P
(
name
,
shorthand
string
,
value
int32
,
usage
string
)
*
int32
{
func
Int32P
(
name
,
shorthand
string
,
value
int32
,
usage
string
)
*
int32
{
return
CommandLine
.
Int32P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Int32P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/int64.go
View file @
681ee126
...
@@ -44,7 +44,7 @@ func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {
...
@@ -44,7 +44,7 @@ func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {
f
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Int64Var, but accepts a shorthand letter that can be used after a single dash.
//
Int64VarP is l
ike Int64Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int64VarP
(
p
*
int64
,
name
,
shorthand
string
,
value
int64
,
usage
string
)
{
func
(
f
*
FlagSet
)
Int64VarP
(
p
*
int64
,
name
,
shorthand
string
,
value
int64
,
usage
string
)
{
f
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -55,7 +55,7 @@ func Int64Var(p *int64, name string, value int64, usage string) {
...
@@ -55,7 +55,7 @@ func Int64Var(p *int64, name string, value int64, usage string) {
CommandLine
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Int64Var, but accepts a shorthand letter that can be used after a single dash.
//
Int64VarP is l
ike Int64Var, but accepts a shorthand letter that can be used after a single dash.
func
Int64VarP
(
p
*
int64
,
name
,
shorthand
string
,
value
int64
,
usage
string
)
{
func
Int64VarP
(
p
*
int64
,
name
,
shorthand
string
,
value
int64
,
usage
string
)
{
CommandLine
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newInt64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -68,7 +68,7 @@ func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
...
@@ -68,7 +68,7 @@ func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
return
p
return
p
}
}
//
L
ike Int64, but accepts a shorthand letter that can be used after a single dash.
//
Int64P is l
ike Int64, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int64P
(
name
,
shorthand
string
,
value
int64
,
usage
string
)
*
int64
{
func
(
f
*
FlagSet
)
Int64P
(
name
,
shorthand
string
,
value
int64
,
usage
string
)
*
int64
{
p
:=
new
(
int64
)
p
:=
new
(
int64
)
f
.
Int64VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Int64VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -81,7 +81,7 @@ func Int64(name string, value int64, usage string) *int64 {
...
@@ -81,7 +81,7 @@ func Int64(name string, value int64, usage string) *int64 {
return
CommandLine
.
Int64P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Int64P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Int64, but accepts a shorthand letter that can be used after a single dash.
//
Int64P is l
ike Int64, but accepts a shorthand letter that can be used after a single dash.
func
Int64P
(
name
,
shorthand
string
,
value
int64
,
usage
string
)
*
int64
{
func
Int64P
(
name
,
shorthand
string
,
value
int64
,
usage
string
)
*
int64
{
return
CommandLine
.
Int64P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Int64P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/int8.go
View file @
681ee126
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
f
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Int8Var, but accepts a shorthand letter that can be used after a single dash.
//
Int8VarP is l
ike Int8Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int8VarP
(
p
*
int8
,
name
,
shorthand
string
,
value
int8
,
usage
string
)
{
func
(
f
*
FlagSet
)
Int8VarP
(
p
*
int8
,
name
,
shorthand
string
,
value
int8
,
usage
string
)
{
f
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -59,7 +59,7 @@ func Int8Var(p *int8, name string, value int8, usage string) {
...
@@ -59,7 +59,7 @@ func Int8Var(p *int8, name string, value int8, usage string) {
CommandLine
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Int8Var, but accepts a shorthand letter that can be used after a single dash.
//
Int8VarP is l
ike Int8Var, but accepts a shorthand letter that can be used after a single dash.
func
Int8VarP
(
p
*
int8
,
name
,
shorthand
string
,
value
int8
,
usage
string
)
{
func
Int8VarP
(
p
*
int8
,
name
,
shorthand
string
,
value
int8
,
usage
string
)
{
CommandLine
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newInt8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
return
p
return
p
}
}
//
L
ike Int8, but accepts a shorthand letter that can be used after a single dash.
//
Int8P is l
ike Int8, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int8P
(
name
,
shorthand
string
,
value
int8
,
usage
string
)
*
int8
{
func
(
f
*
FlagSet
)
Int8P
(
name
,
shorthand
string
,
value
int8
,
usage
string
)
*
int8
{
p
:=
new
(
int8
)
p
:=
new
(
int8
)
f
.
Int8VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Int8VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -85,7 +85,7 @@ func Int8(name string, value int8, usage string) *int8 {
...
@@ -85,7 +85,7 @@ func Int8(name string, value int8, usage string) *int8 {
return
CommandLine
.
Int8P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Int8P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Int8, but accepts a shorthand letter that can be used after a single dash.
//
Int8P is l
ike Int8, but accepts a shorthand letter that can be used after a single dash.
func
Int8P
(
name
,
shorthand
string
,
value
int8
,
usage
string
)
*
int8
{
func
Int8P
(
name
,
shorthand
string
,
value
int8
,
usage
string
)
*
int8
{
return
CommandLine
.
Int8P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Int8P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/int_slice.go
View file @
681ee126
...
@@ -85,7 +85,7 @@ func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string)
...
@@ -85,7 +85,7 @@ func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string)
f
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
//
IntSliceVarP is l
ike IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IntSliceVarP
(
p
*
[]
int
,
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
{
func
(
f
*
FlagSet
)
IntSliceVarP
(
p
*
[]
int
,
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
{
f
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -96,7 +96,7 @@ func IntSliceVar(p *[]int, name string, value []int, usage string) {
...
@@ -96,7 +96,7 @@ func IntSliceVar(p *[]int, name string, value []int, usage string) {
CommandLine
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
//
IntSliceVarP is l
ike IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
func
IntSliceVarP
(
p
*
[]
int
,
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
{
func
IntSliceVarP
(
p
*
[]
int
,
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
{
CommandLine
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newIntSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -104,14 +104,14 @@ func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
...
@@ -104,14 +104,14 @@ func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
// IntSlice defines a []int flag with specified name, default value, and usage string.
// IntSlice defines a []int flag with specified name, default value, and usage string.
// The return value is the address of a []int variable that stores the value of the flag.
// The return value is the address of a []int variable that stores the value of the flag.
func
(
f
*
FlagSet
)
IntSlice
(
name
string
,
value
[]
int
,
usage
string
)
*
[]
int
{
func
(
f
*
FlagSet
)
IntSlice
(
name
string
,
value
[]
int
,
usage
string
)
*
[]
int
{
p
:=
make
([]
int
,
0
)
p
:=
[]
int
{}
f
.
IntSliceVarP
(
&
p
,
name
,
""
,
value
,
usage
)
f
.
IntSliceVarP
(
&
p
,
name
,
""
,
value
,
usage
)
return
&
p
return
&
p
}
}
//
L
ike IntSlice, but accepts a shorthand letter that can be used after a single dash.
//
IntSliceP is l
ike IntSlice, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IntSliceP
(
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
*
[]
int
{
func
(
f
*
FlagSet
)
IntSliceP
(
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
*
[]
int
{
p
:=
make
([]
int
,
0
)
p
:=
[]
int
{}
f
.
IntSliceVarP
(
&
p
,
name
,
shorthand
,
value
,
usage
)
f
.
IntSliceVarP
(
&
p
,
name
,
shorthand
,
value
,
usage
)
return
&
p
return
&
p
}
}
...
@@ -122,7 +122,7 @@ func IntSlice(name string, value []int, usage string) *[]int {
...
@@ -122,7 +122,7 @@ func IntSlice(name string, value []int, usage string) *[]int {
return
CommandLine
.
IntSliceP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
IntSliceP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike IntSlice, but accepts a shorthand letter that can be used after a single dash.
//
IntSliceP is l
ike IntSlice, but accepts a shorthand letter that can be used after a single dash.
func
IntSliceP
(
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
*
[]
int
{
func
IntSliceP
(
name
,
shorthand
string
,
value
[]
int
,
usage
string
)
*
[]
int
{
return
CommandLine
.
IntSliceP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
IntSliceP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/int_slice_test.go
View file @
681ee126
...
@@ -13,13 +13,13 @@ import (
...
@@ -13,13 +13,13 @@ import (
func
setUpISFlagSet
(
isp
*
[]
int
)
*
FlagSet
{
func
setUpISFlagSet
(
isp
*
[]
int
)
*
FlagSet
{
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
.
IntSliceVar
(
isp
,
"is"
,
[]
int
{},
"Command sep
e
rated list!"
)
f
.
IntSliceVar
(
isp
,
"is"
,
[]
int
{},
"Command sep
a
rated list!"
)
return
f
return
f
}
}
func
setUpISFlagSetWithDefault
(
isp
*
[]
int
)
*
FlagSet
{
func
setUpISFlagSetWithDefault
(
isp
*
[]
int
)
*
FlagSet
{
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
.
IntSliceVar
(
isp
,
"is"
,
[]
int
{
0
,
1
},
"Command sep
e
rated list!"
)
f
.
IntSliceVar
(
isp
,
"is"
,
[]
int
{
0
,
1
},
"Command sep
a
rated list!"
)
return
f
return
f
}
}
...
@@ -87,7 +87,7 @@ func TestISDefault(t *testing.T) {
...
@@ -87,7 +87,7 @@ func TestISDefault(t *testing.T) {
t
.
Fatalf
(
"got error: %v"
,
err
)
t
.
Fatalf
(
"got error: %v"
,
err
)
}
}
if
d
!=
v
{
if
d
!=
v
{
t
.
Fatalf
(
"expected is[%d] to be %
s but got: %s
"
,
i
,
d
,
v
)
t
.
Fatalf
(
"expected is[%d] to be %
d but got: %d
"
,
i
,
d
,
v
)
}
}
}
}
...
@@ -101,7 +101,7 @@ func TestISDefault(t *testing.T) {
...
@@ -101,7 +101,7 @@ func TestISDefault(t *testing.T) {
t
.
Fatal
(
"got an error from GetIntSlice():"
,
err
)
t
.
Fatal
(
"got an error from GetIntSlice():"
,
err
)
}
}
if
d
!=
v
{
if
d
!=
v
{
t
.
Fatalf
(
"expected is[%d] to be %
s from GetIntSlice but got: %s
"
,
i
,
d
,
v
)
t
.
Fatalf
(
"expected is[%d] to be %
d from GetIntSlice but got: %d
"
,
i
,
d
,
v
)
}
}
}
}
}
}
...
@@ -122,7 +122,7 @@ func TestISWithDefault(t *testing.T) {
...
@@ -122,7 +122,7 @@ func TestISWithDefault(t *testing.T) {
t
.
Fatalf
(
"got error: %v"
,
err
)
t
.
Fatalf
(
"got error: %v"
,
err
)
}
}
if
d
!=
v
{
if
d
!=
v
{
t
.
Fatalf
(
"expected is[%d] to be %
s but got: %s
"
,
i
,
d
,
v
)
t
.
Fatalf
(
"expected is[%d] to be %
d but got: %d
"
,
i
,
d
,
v
)
}
}
}
}
...
@@ -136,7 +136,7 @@ func TestISWithDefault(t *testing.T) {
...
@@ -136,7 +136,7 @@ func TestISWithDefault(t *testing.T) {
t
.
Fatalf
(
"got error: %v"
,
err
)
t
.
Fatalf
(
"got error: %v"
,
err
)
}
}
if
d
!=
v
{
if
d
!=
v
{
t
.
Fatalf
(
"expected is[%d] to be %
s from GetIntSlice but got: %s
"
,
i
,
d
,
v
)
t
.
Fatalf
(
"expected is[%d] to be %
d from GetIntSlice but got: %d
"
,
i
,
d
,
v
)
}
}
}
}
}
}
...
@@ -156,7 +156,7 @@ func TestISCalledTwice(t *testing.T) {
...
@@ -156,7 +156,7 @@ func TestISCalledTwice(t *testing.T) {
}
}
for
i
,
v
:=
range
is
{
for
i
,
v
:=
range
is
{
if
expected
[
i
]
!=
v
{
if
expected
[
i
]
!=
v
{
t
.
Fatalf
(
"expected is[%d] to be %
s but got: %s
"
,
i
,
expected
[
i
],
v
)
t
.
Fatalf
(
"expected is[%d] to be %
d but got: %d
"
,
i
,
expected
[
i
],
v
)
}
}
}
}
}
}
Godeps/_workspace/src/github.com/spf13/pflag/ip.go
View file @
681ee126
...
@@ -53,7 +53,7 @@ func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {
...
@@ -53,7 +53,7 @@ func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {
f
.
VarP
(
newIPValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newIPValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IPVar, but accepts a shorthand letter that can be used after a single dash.
//
IPVarP is l
ike IPVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IPVarP
(
p
*
net
.
IP
,
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
{
func
(
f
*
FlagSet
)
IPVarP
(
p
*
net
.
IP
,
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
{
f
.
VarP
(
newIPValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newIPValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -64,7 +64,7 @@ func IPVar(p *net.IP, name string, value net.IP, usage string) {
...
@@ -64,7 +64,7 @@ func IPVar(p *net.IP, name string, value net.IP, usage string) {
CommandLine
.
VarP
(
newIPValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newIPValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IPVar, but accepts a shorthand letter that can be used after a single dash.
//
IPVarP is l
ike IPVar, but accepts a shorthand letter that can be used after a single dash.
func
IPVarP
(
p
*
net
.
IP
,
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
{
func
IPVarP
(
p
*
net
.
IP
,
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
{
CommandLine
.
VarP
(
newIPValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newIPValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -77,7 +77,7 @@ func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
...
@@ -77,7 +77,7 @@ func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
return
p
return
p
}
}
//
L
ike IP, but accepts a shorthand letter that can be used after a single dash.
//
IPP is l
ike IP, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IPP
(
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
*
net
.
IP
{
func
(
f
*
FlagSet
)
IPP
(
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
*
net
.
IP
{
p
:=
new
(
net
.
IP
)
p
:=
new
(
net
.
IP
)
f
.
IPVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
IPVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -90,7 +90,7 @@ func IP(name string, value net.IP, usage string) *net.IP {
...
@@ -90,7 +90,7 @@ func IP(name string, value net.IP, usage string) *net.IP {
return
CommandLine
.
IPP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
IPP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike IP, but accepts a shorthand letter that can be used after a single dash.
//
IPP is l
ike IP, but accepts a shorthand letter that can be used after a single dash.
func
IPP
(
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
*
net
.
IP
{
func
IPP
(
name
,
shorthand
string
,
value
net
.
IP
,
usage
string
)
*
net
.
IP
{
return
CommandLine
.
IPP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
IPP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/ipmask.go
View file @
681ee126
...
@@ -28,7 +28,7 @@ func (i *ipMaskValue) Type() string {
...
@@ -28,7 +28,7 @@ func (i *ipMaskValue) Type() string {
return
"ipMask"
return
"ipMask"
}
}
// Parse
IPv4 netm
ask written in IP form (e.g. 255.255.255.0).
// Parse
IPv4M
ask written in IP form (e.g. 255.255.255.0).
// This function should really belong to the net package.
// This function should really belong to the net package.
func
ParseIPv4Mask
(
s
string
)
net
.
IPMask
{
func
ParseIPv4Mask
(
s
string
)
net
.
IPMask
{
mask
:=
net
.
ParseIP
(
s
)
mask
:=
net
.
ParseIP
(
s
)
...
@@ -79,7 +79,7 @@ func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage
...
@@ -79,7 +79,7 @@ func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage
f
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
//
IPMaskVarP is l
ike IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IPMaskVarP
(
p
*
net
.
IPMask
,
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
{
func
(
f
*
FlagSet
)
IPMaskVarP
(
p
*
net
.
IPMask
,
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
{
f
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -90,7 +90,7 @@ func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
...
@@ -90,7 +90,7 @@ func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
CommandLine
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
//
IPMaskVarP is l
ike IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
func
IPMaskVarP
(
p
*
net
.
IPMask
,
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
{
func
IPMaskVarP
(
p
*
net
.
IPMask
,
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
{
CommandLine
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newIPMaskValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -103,7 +103,7 @@ func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMas
...
@@ -103,7 +103,7 @@ func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMas
return
p
return
p
}
}
//
L
ike IPMask, but accepts a shorthand letter that can be used after a single dash.
//
IPMaskP is l
ike IPMask, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IPMaskP
(
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
*
net
.
IPMask
{
func
(
f
*
FlagSet
)
IPMaskP
(
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
*
net
.
IPMask
{
p
:=
new
(
net
.
IPMask
)
p
:=
new
(
net
.
IPMask
)
f
.
IPMaskVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
IPMaskVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -116,7 +116,7 @@ func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
...
@@ -116,7 +116,7 @@ func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
return
CommandLine
.
IPMaskP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
IPMaskP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike IP, but accepts a shorthand letter that can be used after a single dash.
//
IPMaskP is l
ike IP, but accepts a shorthand letter that can be used after a single dash.
func
IPMaskP
(
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
*
net
.
IPMask
{
func
IPMaskP
(
name
,
shorthand
string
,
value
net
.
IPMask
,
usage
string
)
*
net
.
IPMask
{
return
CommandLine
.
IPMaskP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
IPMaskP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/ipnet.go
View file @
681ee126
...
@@ -7,31 +7,31 @@ import (
...
@@ -7,31 +7,31 @@ import (
)
)
// IPNet adapts net.IPNet for use as a flag.
// IPNet adapts net.IPNet for use as a flag.
type
IP
NetValue
net
.
IPNet
type
ip
NetValue
net
.
IPNet
func
(
ipnet
IP
NetValue
)
String
()
string
{
func
(
ipnet
ip
NetValue
)
String
()
string
{
n
:=
net
.
IPNet
(
ipnet
)
n
:=
net
.
IPNet
(
ipnet
)
return
n
.
String
()
return
n
.
String
()
}
}
func
(
ipnet
*
IP
NetValue
)
Set
(
value
string
)
error
{
func
(
ipnet
*
ip
NetValue
)
Set
(
value
string
)
error
{
_
,
n
,
err
:=
net
.
ParseCIDR
(
strings
.
TrimSpace
(
value
))
_
,
n
,
err
:=
net
.
ParseCIDR
(
strings
.
TrimSpace
(
value
))
if
err
!=
nil
{
if
err
!=
nil
{
return
err
return
err
}
}
*
ipnet
=
IP
NetValue
(
*
n
)
*
ipnet
=
ip
NetValue
(
*
n
)
return
nil
return
nil
}
}
func
(
*
IP
NetValue
)
Type
()
string
{
func
(
*
ip
NetValue
)
Type
()
string
{
return
"ipNet"
return
"ipNet"
}
}
var
_
=
strings
.
TrimSpace
var
_
=
strings
.
TrimSpace
func
newIPNetValue
(
val
net
.
IPNet
,
p
*
net
.
IPNet
)
*
IP
NetValue
{
func
newIPNetValue
(
val
net
.
IPNet
,
p
*
net
.
IPNet
)
*
ip
NetValue
{
*
p
=
val
*
p
=
val
return
(
*
IP
NetValue
)(
p
)
return
(
*
ip
NetValue
)(
p
)
}
}
func
ipNetConv
(
sval
string
)
(
interface
{},
error
)
{
func
ipNetConv
(
sval
string
)
(
interface
{},
error
)
{
...
@@ -57,7 +57,7 @@ func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage str
...
@@ -57,7 +57,7 @@ func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage str
f
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IPNetVar, but accepts a shorthand letter that can be used after a single dash.
//
IPNetVarP is l
ike IPNetVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IPNetVarP
(
p
*
net
.
IPNet
,
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
{
func
(
f
*
FlagSet
)
IPNetVarP
(
p
*
net
.
IPNet
,
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
{
f
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -68,7 +68,7 @@ func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
...
@@ -68,7 +68,7 @@ func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
CommandLine
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike IPNetVar, but accepts a shorthand letter that can be used after a single dash.
//
IPNetVarP is l
ike IPNetVar, but accepts a shorthand letter that can be used after a single dash.
func
IPNetVarP
(
p
*
net
.
IPNet
,
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
{
func
IPNetVarP
(
p
*
net
.
IPNet
,
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
{
CommandLine
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newIPNetValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -81,7 +81,7 @@ func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet {
...
@@ -81,7 +81,7 @@ func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet {
return
p
return
p
}
}
//
L
ike IPNet, but accepts a shorthand letter that can be used after a single dash.
//
IPNetP is l
ike IPNet, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
IPNetP
(
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
*
net
.
IPNet
{
func
(
f
*
FlagSet
)
IPNetP
(
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
*
net
.
IPNet
{
p
:=
new
(
net
.
IPNet
)
p
:=
new
(
net
.
IPNet
)
f
.
IPNetVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
IPNetVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -94,7 +94,7 @@ func IPNet(name string, value net.IPNet, usage string) *net.IPNet {
...
@@ -94,7 +94,7 @@ func IPNet(name string, value net.IPNet, usage string) *net.IPNet {
return
CommandLine
.
IPNetP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
IPNetP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike IPNet, but accepts a shorthand letter that can be used after a single dash.
//
IPNetP is l
ike IPNet, but accepts a shorthand letter that can be used after a single dash.
func
IPNetP
(
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
*
net
.
IPNet
{
func
IPNetP
(
name
,
shorthand
string
,
value
net
.
IPNet
,
usage
string
)
*
net
.
IPNet
{
return
CommandLine
.
IPNetP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
IPNetP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/string.go
View file @
681ee126
...
@@ -39,7 +39,7 @@ func (f *FlagSet) StringVar(p *string, name string, value string, usage string)
...
@@ -39,7 +39,7 @@ func (f *FlagSet) StringVar(p *string, name string, value string, usage string)
f
.
VarP
(
newStringValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newStringValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike StringVar, but accepts a shorthand letter that can be used after a single dash.
//
StringVarP is l
ike StringVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
StringVarP
(
p
*
string
,
name
,
shorthand
string
,
value
string
,
usage
string
)
{
func
(
f
*
FlagSet
)
StringVarP
(
p
*
string
,
name
,
shorthand
string
,
value
string
,
usage
string
)
{
f
.
VarP
(
newStringValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newStringValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -50,7 +50,7 @@ func StringVar(p *string, name string, value string, usage string) {
...
@@ -50,7 +50,7 @@ func StringVar(p *string, name string, value string, usage string) {
CommandLine
.
VarP
(
newStringValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newStringValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike StringVar, but accepts a shorthand letter that can be used after a single dash.
//
StringVarP is l
ike StringVar, but accepts a shorthand letter that can be used after a single dash.
func
StringVarP
(
p
*
string
,
name
,
shorthand
string
,
value
string
,
usage
string
)
{
func
StringVarP
(
p
*
string
,
name
,
shorthand
string
,
value
string
,
usage
string
)
{
CommandLine
.
VarP
(
newStringValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newStringValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -63,7 +63,7 @@ func (f *FlagSet) String(name string, value string, usage string) *string {
...
@@ -63,7 +63,7 @@ func (f *FlagSet) String(name string, value string, usage string) *string {
return
p
return
p
}
}
//
L
ike String, but accepts a shorthand letter that can be used after a single dash.
//
StringP is l
ike String, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
StringP
(
name
,
shorthand
string
,
value
string
,
usage
string
)
*
string
{
func
(
f
*
FlagSet
)
StringP
(
name
,
shorthand
string
,
value
string
,
usage
string
)
*
string
{
p
:=
new
(
string
)
p
:=
new
(
string
)
f
.
StringVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
StringVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -76,7 +76,7 @@ func String(name string, value string, usage string) *string {
...
@@ -76,7 +76,7 @@ func String(name string, value string, usage string) *string {
return
CommandLine
.
StringP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
StringP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike String, but accepts a shorthand letter that can be used after a single dash.
//
StringP is l
ike String, but accepts a shorthand letter that can be used after a single dash.
func
StringP
(
name
,
shorthand
string
,
value
string
,
usage
string
)
*
string
{
func
StringP
(
name
,
shorthand
string
,
value
string
,
usage
string
)
*
string
{
return
CommandLine
.
StringP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
StringP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/string_slice.go
View file @
681ee126
...
@@ -62,7 +62,7 @@ func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage
...
@@ -62,7 +62,7 @@ func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage
f
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
//
StringSliceVarP is l
ike StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
StringSliceVarP
(
p
*
[]
string
,
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
{
func
(
f
*
FlagSet
)
StringSliceVarP
(
p
*
[]
string
,
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
{
f
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -73,7 +73,7 @@ func StringSliceVar(p *[]string, name string, value []string, usage string) {
...
@@ -73,7 +73,7 @@ func StringSliceVar(p *[]string, name string, value []string, usage string) {
CommandLine
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
//
StringSliceVarP is l
ike StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
func
StringSliceVarP
(
p
*
[]
string
,
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
{
func
StringSliceVarP
(
p
*
[]
string
,
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
{
CommandLine
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newStringSliceValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -81,14 +81,14 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage
...
@@ -81,14 +81,14 @@ func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage
// StringSlice defines a string flag with specified name, default value, and usage string.
// StringSlice defines a string flag with specified name, default value, and usage string.
// The return value is the address of a []string variable that stores the value of the flag.
// The return value is the address of a []string variable that stores the value of the flag.
func
(
f
*
FlagSet
)
StringSlice
(
name
string
,
value
[]
string
,
usage
string
)
*
[]
string
{
func
(
f
*
FlagSet
)
StringSlice
(
name
string
,
value
[]
string
,
usage
string
)
*
[]
string
{
p
:=
make
([]
string
,
0
)
p
:=
[]
string
{}
f
.
StringSliceVarP
(
&
p
,
name
,
""
,
value
,
usage
)
f
.
StringSliceVarP
(
&
p
,
name
,
""
,
value
,
usage
)
return
&
p
return
&
p
}
}
//
L
ike StringSlice, but accepts a shorthand letter that can be used after a single dash.
//
StringSliceP is l
ike StringSlice, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
StringSliceP
(
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
*
[]
string
{
func
(
f
*
FlagSet
)
StringSliceP
(
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
*
[]
string
{
p
:=
make
([]
string
,
0
)
p
:=
[]
string
{}
f
.
StringSliceVarP
(
&
p
,
name
,
shorthand
,
value
,
usage
)
f
.
StringSliceVarP
(
&
p
,
name
,
shorthand
,
value
,
usage
)
return
&
p
return
&
p
}
}
...
@@ -99,7 +99,7 @@ func StringSlice(name string, value []string, usage string) *[]string {
...
@@ -99,7 +99,7 @@ func StringSlice(name string, value []string, usage string) *[]string {
return
CommandLine
.
StringSliceP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
StringSliceP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike StringSlice, but accepts a shorthand letter that can be used after a single dash.
//
StringSliceP is l
ike StringSlice, but accepts a shorthand letter that can be used after a single dash.
func
StringSliceP
(
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
*
[]
string
{
func
StringSliceP
(
name
,
shorthand
string
,
value
[]
string
,
usage
string
)
*
[]
string
{
return
CommandLine
.
StringSliceP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
StringSliceP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/string_slice_test.go
View file @
681ee126
...
@@ -12,13 +12,13 @@ import (
...
@@ -12,13 +12,13 @@ import (
func
setUpSSFlagSet
(
ssp
*
[]
string
)
*
FlagSet
{
func
setUpSSFlagSet
(
ssp
*
[]
string
)
*
FlagSet
{
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
.
StringSliceVar
(
ssp
,
"ss"
,
[]
string
{},
"Command sep
e
rated list!"
)
f
.
StringSliceVar
(
ssp
,
"ss"
,
[]
string
{},
"Command sep
a
rated list!"
)
return
f
return
f
}
}
func
setUpSSFlagSetWithDefault
(
ssp
*
[]
string
)
*
FlagSet
{
func
setUpSSFlagSetWithDefault
(
ssp
*
[]
string
)
*
FlagSet
{
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
:=
NewFlagSet
(
"test"
,
ContinueOnError
)
f
.
StringSliceVar
(
ssp
,
"ss"
,
[]
string
{
"default"
,
"values"
},
"Command sep
e
rated list!"
)
f
.
StringSliceVar
(
ssp
,
"ss"
,
[]
string
{
"default"
,
"values"
},
"Command sep
a
rated list!"
)
return
f
return
f
}
}
...
...
Godeps/_workspace/src/github.com/spf13/pflag/uint.go
View file @
681ee126
...
@@ -48,7 +48,7 @@ func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
...
@@ -48,7 +48,7 @@ func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
f
.
VarP
(
newUintValue
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newUintValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike UintVar, but accepts a shorthand letter that can be used after a single dash.
//
UintVarP is l
ike UintVar, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
UintVarP
(
p
*
uint
,
name
,
shorthand
string
,
value
uint
,
usage
string
)
{
func
(
f
*
FlagSet
)
UintVarP
(
p
*
uint
,
name
,
shorthand
string
,
value
uint
,
usage
string
)
{
f
.
VarP
(
newUintValue
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newUintValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -59,7 +59,7 @@ func UintVar(p *uint, name string, value uint, usage string) {
...
@@ -59,7 +59,7 @@ func UintVar(p *uint, name string, value uint, usage string) {
CommandLine
.
VarP
(
newUintValue
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newUintValue
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike UintVar, but accepts a shorthand letter that can be used after a single dash.
//
UintVarP is l
ike UintVar, but accepts a shorthand letter that can be used after a single dash.
func
UintVarP
(
p
*
uint
,
name
,
shorthand
string
,
value
uint
,
usage
string
)
{
func
UintVarP
(
p
*
uint
,
name
,
shorthand
string
,
value
uint
,
usage
string
)
{
CommandLine
.
VarP
(
newUintValue
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newUintValue
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
return
p
return
p
}
}
//
L
ike Uint, but accepts a shorthand letter that can be used after a single dash.
//
UintP is l
ike Uint, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
UintP
(
name
,
shorthand
string
,
value
uint
,
usage
string
)
*
uint
{
func
(
f
*
FlagSet
)
UintP
(
name
,
shorthand
string
,
value
uint
,
usage
string
)
*
uint
{
p
:=
new
(
uint
)
p
:=
new
(
uint
)
f
.
UintVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
UintVarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -85,7 +85,7 @@ func Uint(name string, value uint, usage string) *uint {
...
@@ -85,7 +85,7 @@ func Uint(name string, value uint, usage string) *uint {
return
CommandLine
.
UintP
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
UintP
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Uint, but accepts a shorthand letter that can be used after a single dash.
//
UintP is l
ike Uint, but accepts a shorthand letter that can be used after a single dash.
func
UintP
(
name
,
shorthand
string
,
value
uint
,
usage
string
)
*
uint
{
func
UintP
(
name
,
shorthand
string
,
value
uint
,
usage
string
)
*
uint
{
return
CommandLine
.
UintP
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
UintP
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/uint16.go
View file @
681ee126
...
@@ -46,7 +46,7 @@ func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string)
...
@@ -46,7 +46,7 @@ func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string)
f
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint16Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint16VarP is l
ike Uint16Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint16VarP
(
p
*
uint16
,
name
,
shorthand
string
,
value
uint16
,
usage
string
)
{
func
(
f
*
FlagSet
)
Uint16VarP
(
p
*
uint16
,
name
,
shorthand
string
,
value
uint16
,
usage
string
)
{
f
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -57,7 +57,7 @@ func Uint16Var(p *uint16, name string, value uint16, usage string) {
...
@@ -57,7 +57,7 @@ func Uint16Var(p *uint16, name string, value uint16, usage string) {
CommandLine
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint16Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint16VarP is l
ike Uint16Var, but accepts a shorthand letter that can be used after a single dash.
func
Uint16VarP
(
p
*
uint16
,
name
,
shorthand
string
,
value
uint16
,
usage
string
)
{
func
Uint16VarP
(
p
*
uint16
,
name
,
shorthand
string
,
value
uint16
,
usage
string
)
{
CommandLine
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newUint16Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -70,7 +70,7 @@ func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
...
@@ -70,7 +70,7 @@ func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
return
p
return
p
}
}
//
L
ike Uint16, but accepts a shorthand letter that can be used after a single dash.
//
Uint16P is l
ike Uint16, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint16P
(
name
,
shorthand
string
,
value
uint16
,
usage
string
)
*
uint16
{
func
(
f
*
FlagSet
)
Uint16P
(
name
,
shorthand
string
,
value
uint16
,
usage
string
)
*
uint16
{
p
:=
new
(
uint16
)
p
:=
new
(
uint16
)
f
.
Uint16VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Uint16VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -83,7 +83,7 @@ func Uint16(name string, value uint16, usage string) *uint16 {
...
@@ -83,7 +83,7 @@ func Uint16(name string, value uint16, usage string) *uint16 {
return
CommandLine
.
Uint16P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Uint16P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Uint16, but accepts a shorthand letter that can be used after a single dash.
//
Uint16P is l
ike Uint16, but accepts a shorthand letter that can be used after a single dash.
func
Uint16P
(
name
,
shorthand
string
,
value
uint16
,
usage
string
)
*
uint16
{
func
Uint16P
(
name
,
shorthand
string
,
value
uint16
,
usage
string
)
*
uint16
{
return
CommandLine
.
Uint16P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Uint16P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/uint32.go
View file @
681ee126
...
@@ -46,7 +46,7 @@ func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string)
...
@@ -46,7 +46,7 @@ func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string)
f
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint32Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint32VarP is l
ike Uint32Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint32VarP
(
p
*
uint32
,
name
,
shorthand
string
,
value
uint32
,
usage
string
)
{
func
(
f
*
FlagSet
)
Uint32VarP
(
p
*
uint32
,
name
,
shorthand
string
,
value
uint32
,
usage
string
)
{
f
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -57,7 +57,7 @@ func Uint32Var(p *uint32, name string, value uint32, usage string) {
...
@@ -57,7 +57,7 @@ func Uint32Var(p *uint32, name string, value uint32, usage string) {
CommandLine
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint32Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint32VarP is l
ike Uint32Var, but accepts a shorthand letter that can be used after a single dash.
func
Uint32VarP
(
p
*
uint32
,
name
,
shorthand
string
,
value
uint32
,
usage
string
)
{
func
Uint32VarP
(
p
*
uint32
,
name
,
shorthand
string
,
value
uint32
,
usage
string
)
{
CommandLine
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newUint32Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -70,7 +70,7 @@ func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
...
@@ -70,7 +70,7 @@ func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
return
p
return
p
}
}
//
L
ike Uint32, but accepts a shorthand letter that can be used after a single dash.
//
Uint32P is l
ike Uint32, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint32P
(
name
,
shorthand
string
,
value
uint32
,
usage
string
)
*
uint32
{
func
(
f
*
FlagSet
)
Uint32P
(
name
,
shorthand
string
,
value
uint32
,
usage
string
)
*
uint32
{
p
:=
new
(
uint32
)
p
:=
new
(
uint32
)
f
.
Uint32VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Uint32VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -83,7 +83,7 @@ func Uint32(name string, value uint32, usage string) *uint32 {
...
@@ -83,7 +83,7 @@ func Uint32(name string, value uint32, usage string) *uint32 {
return
CommandLine
.
Uint32P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Uint32P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Uint32, but accepts a shorthand letter that can be used after a single dash.
//
Uint32P is l
ike Uint32, but accepts a shorthand letter that can be used after a single dash.
func
Uint32P
(
name
,
shorthand
string
,
value
uint32
,
usage
string
)
*
uint32
{
func
Uint32P
(
name
,
shorthand
string
,
value
uint32
,
usage
string
)
*
uint32
{
return
CommandLine
.
Uint32P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Uint32P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/uint64.go
View file @
681ee126
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string)
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string)
f
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint64Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint64VarP is l
ike Uint64Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint64VarP
(
p
*
uint64
,
name
,
shorthand
string
,
value
uint64
,
usage
string
)
{
func
(
f
*
FlagSet
)
Uint64VarP
(
p
*
uint64
,
name
,
shorthand
string
,
value
uint64
,
usage
string
)
{
f
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -59,7 +59,7 @@ func Uint64Var(p *uint64, name string, value uint64, usage string) {
...
@@ -59,7 +59,7 @@ func Uint64Var(p *uint64, name string, value uint64, usage string) {
CommandLine
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint64Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint64VarP is l
ike Uint64Var, but accepts a shorthand letter that can be used after a single dash.
func
Uint64VarP
(
p
*
uint64
,
name
,
shorthand
string
,
value
uint64
,
usage
string
)
{
func
Uint64VarP
(
p
*
uint64
,
name
,
shorthand
string
,
value
uint64
,
usage
string
)
{
CommandLine
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newUint64Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
return
p
return
p
}
}
//
L
ike Uint64, but accepts a shorthand letter that can be used after a single dash.
//
Uint64P is l
ike Uint64, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint64P
(
name
,
shorthand
string
,
value
uint64
,
usage
string
)
*
uint64
{
func
(
f
*
FlagSet
)
Uint64P
(
name
,
shorthand
string
,
value
uint64
,
usage
string
)
*
uint64
{
p
:=
new
(
uint64
)
p
:=
new
(
uint64
)
f
.
Uint64VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Uint64VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -85,7 +85,7 @@ func Uint64(name string, value uint64, usage string) *uint64 {
...
@@ -85,7 +85,7 @@ func Uint64(name string, value uint64, usage string) *uint64 {
return
CommandLine
.
Uint64P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Uint64P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Uint64, but accepts a shorthand letter that can be used after a single dash.
//
Uint64P is l
ike Uint64, but accepts a shorthand letter that can be used after a single dash.
func
Uint64P
(
name
,
shorthand
string
,
value
uint64
,
usage
string
)
*
uint64
{
func
Uint64P
(
name
,
shorthand
string
,
value
uint64
,
usage
string
)
*
uint64
{
return
CommandLine
.
Uint64P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Uint64P
(
name
,
shorthand
,
value
,
usage
)
}
}
Godeps/_workspace/src/github.com/spf13/pflag/uint8.go
View file @
681ee126
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {
...
@@ -48,7 +48,7 @@ func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {
f
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
""
,
usage
)
f
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint8Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint8VarP is l
ike Uint8Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint8VarP
(
p
*
uint8
,
name
,
shorthand
string
,
value
uint8
,
usage
string
)
{
func
(
f
*
FlagSet
)
Uint8VarP
(
p
*
uint8
,
name
,
shorthand
string
,
value
uint8
,
usage
string
)
{
f
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
f
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -59,7 +59,7 @@ func Uint8Var(p *uint8, name string, value uint8, usage string) {
...
@@ -59,7 +59,7 @@ func Uint8Var(p *uint8, name string, value uint8, usage string) {
CommandLine
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
""
,
usage
)
CommandLine
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
""
,
usage
)
}
}
//
L
ike Uint8Var, but accepts a shorthand letter that can be used after a single dash.
//
Uint8VarP is l
ike Uint8Var, but accepts a shorthand letter that can be used after a single dash.
func
Uint8VarP
(
p
*
uint8
,
name
,
shorthand
string
,
value
uint8
,
usage
string
)
{
func
Uint8VarP
(
p
*
uint8
,
name
,
shorthand
string
,
value
uint8
,
usage
string
)
{
CommandLine
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
CommandLine
.
VarP
(
newUint8Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
}
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
...
@@ -72,7 +72,7 @@ func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
return
p
return
p
}
}
//
L
ike Uint8, but accepts a shorthand letter that can be used after a single dash.
//
Uint8P is l
ike Uint8, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Uint8P
(
name
,
shorthand
string
,
value
uint8
,
usage
string
)
*
uint8
{
func
(
f
*
FlagSet
)
Uint8P
(
name
,
shorthand
string
,
value
uint8
,
usage
string
)
*
uint8
{
p
:=
new
(
uint8
)
p
:=
new
(
uint8
)
f
.
Uint8VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
f
.
Uint8VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
...
@@ -85,7 +85,7 @@ func Uint8(name string, value uint8, usage string) *uint8 {
...
@@ -85,7 +85,7 @@ func Uint8(name string, value uint8, usage string) *uint8 {
return
CommandLine
.
Uint8P
(
name
,
""
,
value
,
usage
)
return
CommandLine
.
Uint8P
(
name
,
""
,
value
,
usage
)
}
}
//
L
ike Uint8, but accepts a shorthand letter that can be used after a single dash.
//
Uint8P is l
ike Uint8, but accepts a shorthand letter that can be used after a single dash.
func
Uint8P
(
name
,
shorthand
string
,
value
uint8
,
usage
string
)
*
uint8
{
func
Uint8P
(
name
,
shorthand
string
,
value
uint8
,
usage
string
)
*
uint8
{
return
CommandLine
.
Uint8P
(
name
,
shorthand
,
value
,
usage
)
return
CommandLine
.
Uint8P
(
name
,
shorthand
,
value
,
usage
)
}
}
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment