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
6c54ec59
Commit
6c54ec59
authored
Nov 20, 2017
by
Di Xu
Browse files
Options
Browse Files
Download
Email Patches
Plain Diff
bump pflag
parent
ddf97084
Expand all
Hide whitespace changes
Inline
Side-by-side
Showing
17 changed files
with
142 additions
and
31 deletions
+142
-31
Godeps.json
Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/api/Godeps/Godeps.json
+1
-1
Godeps.json
...ing/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/apimachinery/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/apiserver/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/client-go/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/code-generator/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/metrics/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
+1
-1
Godeps.json
staging/src/k8s.io/sample-controller/Godeps/Godeps.json
+1
-1
.travis.yml
vendor/github.com/spf13/pflag/.travis.yml
+11
-10
BUILD
vendor/github.com/spf13/pflag/BUILD
+1
-0
README.md
vendor/github.com/spf13/pflag/README.md
+22
-3
count.go
vendor/github.com/spf13/pflag/count.go
+9
-7
flag.go
vendor/github.com/spf13/pflag/flag.go
+0
-0
int16.go
vendor/github.com/spf13/pflag/int16.go
+88
-0
No files found.
Godeps/Godeps.json
View file @
6c54ec59
...
@@ -2482,7 +2482,7 @@
...
@@ -2482,7 +2482,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/spf13/viper"
,
"ImportPath"
:
"github.com/spf13/viper"
,
...
...
staging/src/k8s.io/api/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -68,7 +68,7 @@
...
@@ -68,7 +68,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"golang.org/x/net/http2"
,
"ImportPath"
:
"golang.org/x/net/http2"
,
...
...
staging/src/k8s.io/apiextensions-apiserver/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -332,7 +332,7 @@
...
@@ -332,7 +332,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
...
...
staging/src/k8s.io/apimachinery/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
...
...
staging/src/k8s.io/apiserver/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -552,7 +552,7 @@
...
@@ -552,7 +552,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
...
...
staging/src/k8s.io/client-go/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -256,7 +256,7 @@
...
@@ -256,7 +256,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
...
...
staging/src/k8s.io/code-generator/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -156,7 +156,7 @@
...
@@ -156,7 +156,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"golang.org/x/net/idna"
,
"ImportPath"
:
"golang.org/x/net/idna"
,
...
...
staging/src/k8s.io/kube-aggregator/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -312,7 +312,7 @@
...
@@ -312,7 +312,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
"ImportPath"
:
"github.com/stretchr/testify/assert"
,
...
...
staging/src/k8s.io/metrics/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -128,7 +128,7 @@
...
@@ -128,7 +128,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"golang.org/x/net/http2"
,
"ImportPath"
:
"golang.org/x/net/http2"
,
...
...
staging/src/k8s.io/sample-apiserver/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -300,7 +300,7 @@
...
@@ -300,7 +300,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"github.com/ugorji/go/codec"
,
"ImportPath"
:
"github.com/ugorji/go/codec"
,
...
...
staging/src/k8s.io/sample-controller/Godeps/Godeps.json
View file @
6c54ec59
...
@@ -152,7 +152,7 @@
...
@@ -152,7 +152,7 @@
},
},
{
{
"ImportPath"
:
"github.com/spf13/pflag"
,
"ImportPath"
:
"github.com/spf13/pflag"
,
"Rev"
:
"
9ff6c6923cfffbcd502984b8e0c80539a94968b7
"
"Rev"
:
"
4c012f6dcd9546820e378d0bdda4d8fc772cdfea
"
},
},
{
{
"ImportPath"
:
"golang.org/x/crypto/ssh/terminal"
,
"ImportPath"
:
"golang.org/x/crypto/ssh/terminal"
,
...
...
vendor/github.com/spf13/pflag/.travis.yml
View file @
6c54ec59
...
@@ -3,18 +3,19 @@ sudo: false
...
@@ -3,18 +3,19 @@ sudo: false
language
:
go
language
:
go
go
:
go
:
-
1.6
.3
-
1.7
.3
-
1.7.3
-
1.8.1
-
tip
-
tip
matrix
:
matrix
:
allow_failures
:
allow_failures
:
-
go
:
tip
-
go
:
tip
install
:
install
:
-
go get github.com/golang/lint/golint
-
go get github.com/golang/lint/golint
-
export PATH=$GOPATH/bin:$PATH
-
export PATH=$GOPATH/bin:$PATH
-
go install ./...
-
go install ./...
script
:
script
:
-
verify/all.sh -v
-
verify/all.sh -v
-
go test ./...
-
go test ./...
vendor/github.com/spf13/pflag/BUILD
View file @
6c54ec59
...
@@ -12,6 +12,7 @@ go_library(
...
@@ -12,6 +12,7 @@ go_library(
"float64.go",
"float64.go",
"golangflag.go",
"golangflag.go",
"int.go",
"int.go",
"int16.go",
"int32.go",
"int32.go",
"int64.go",
"int64.go",
"int8.go",
"int8.go",
...
...
vendor/github.com/spf13/pflag/README.md
View file @
6c54ec59
...
@@ -246,6 +246,25 @@ It is possible to mark a flag as hidden, meaning it will still function as norma
...
@@ -246,6 +246,25 @@ It is possible to mark a flag as hidden, meaning it will still function as norma
flags
.
MarkHidden
(
"secretFlag"
)
flags
.
MarkHidden
(
"secretFlag"
)
```
```
## Disable sorting of flags
`pflag`
allows you to disable sorting of flags for help and usage message.
**Example**
:
```
go
flags
.
BoolP
(
"verbose"
,
"v"
,
false
,
"verbose output"
)
flags
.
String
(
"coolflag"
,
"yeaah"
,
"it's really cool flag"
)
flags
.
Int
(
"usefulflag"
,
777
,
"sometimes it's very useful"
)
flags
.
SortFlags
=
false
flags
.
PrintDefaults
()
```
**Output**
:
```
-v, --verbose verbose output
--coolflag string it's really cool flag (default "yeaah")
--usefulflag int sometimes it's very useful (default 777)
```
## Supporting Go flags when using pflag
## Supporting Go flags when using pflag
In order to support flags defined using Go's
`flag`
package, they must be added to the
`pflag`
flagset. This is usually necessary
In order to support flags defined using Go's
`flag`
package, they must be added to the
`pflag`
flagset. This is usually necessary
to support flags defined by third-party dependencies (e.g.
`golang/glog`
).
to support flags defined by third-party dependencies (e.g.
`golang/glog`
).
...
@@ -270,8 +289,8 @@ func main() {
...
@@ -270,8 +289,8 @@ func main() {
You can see the full reference documentation of the pflag package
You can see the full reference documentation of the pflag package
[
at godoc.org
][
3
]
, or through go's standard documentation system by
[
at godoc.org
][
3
]
, or through go's standard documentation system by
running
`godoc -http=:6060`
and browsing to
running
`godoc -http=:6060`
and browsing to
[
http://localhost:6060/pkg/github.com/
ogier
/pflag
][
2
]
after
[
http://localhost:6060/pkg/github.com/
spf13
/pflag
][
2
]
after
installation.
installation.
[
2
]:
http://localhost:6060/pkg/github.com/
ogier
/pflag
[
2
]:
http://localhost:6060/pkg/github.com/
spf13
/pflag
[
3
]:
http://godoc.org/github.com/
ogier
/pflag
[
3
]:
http://godoc.org/github.com/
spf13
/pflag
vendor/github.com/spf13/pflag/count.go
View file @
6c54ec59
...
@@ -11,13 +11,13 @@ func newCountValue(val int, p *int) *countValue {
...
@@ -11,13 +11,13 @@ func newCountValue(val int, p *int) *countValue {
}
}
func
(
i
*
countValue
)
Set
(
s
string
)
error
{
func
(
i
*
countValue
)
Set
(
s
string
)
error
{
v
,
err
:=
strconv
.
ParseInt
(
s
,
0
,
64
)
// "+1" means that no specific value was passed, so increment
// -1 means that no specific value was passed, so increment
if
s
==
"+1"
{
if
v
==
-
1
{
*
i
=
countValue
(
*
i
+
1
)
*
i
=
countValue
(
*
i
+
1
)
}
else
{
return
nil
*
i
=
countValue
(
v
)
}
}
v
,
err
:=
strconv
.
ParseInt
(
s
,
0
,
0
)
*
i
=
countValue
(
v
)
return
err
return
err
}
}
...
@@ -54,7 +54,7 @@ func (f *FlagSet) CountVar(p *int, name string, usage string) {
...
@@ -54,7 +54,7 @@ func (f *FlagSet) CountVar(p *int, name string, usage string) {
// CountVarP is like CountVar only take a shorthand for the flag name.
// 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
// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set
...
@@ -83,7 +83,9 @@ func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
...
@@ -83,7 +83,9 @@ func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
return
p
return
p
}
}
// Count like Count only the flag is placed on the CommandLine isntead of a given flag set
// 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
Count
(
name
string
,
usage
string
)
*
int
{
func
Count
(
name
string
,
usage
string
)
*
int
{
return
CommandLine
.
CountP
(
name
,
""
,
usage
)
return
CommandLine
.
CountP
(
name
,
""
,
usage
)
}
}
...
...
vendor/github.com/spf13/pflag/flag.go
View file @
6c54ec59
This diff is collapsed.
Click to expand it.
vendor/github.com/spf13/pflag/int16.go
0 → 100644
View file @
6c54ec59
package
pflag
import
"strconv"
// -- int16 Value
type
int16Value
int16
func
newInt16Value
(
val
int16
,
p
*
int16
)
*
int16Value
{
*
p
=
val
return
(
*
int16Value
)(
p
)
}
func
(
i
*
int16Value
)
Set
(
s
string
)
error
{
v
,
err
:=
strconv
.
ParseInt
(
s
,
0
,
16
)
*
i
=
int16Value
(
v
)
return
err
}
func
(
i
*
int16Value
)
Type
()
string
{
return
"int16"
}
func
(
i
*
int16Value
)
String
()
string
{
return
strconv
.
FormatInt
(
int64
(
*
i
),
10
)
}
func
int16Conv
(
sval
string
)
(
interface
{},
error
)
{
v
,
err
:=
strconv
.
ParseInt
(
sval
,
0
,
16
)
if
err
!=
nil
{
return
0
,
err
}
return
int16
(
v
),
nil
}
// GetInt16 returns the int16 value of a flag with the given name
func
(
f
*
FlagSet
)
GetInt16
(
name
string
)
(
int16
,
error
)
{
val
,
err
:=
f
.
getFlagType
(
name
,
"int16"
,
int16Conv
)
if
err
!=
nil
{
return
0
,
err
}
return
val
.
(
int16
),
nil
}
// Int16Var defines an int16 flag with specified name, default value, and usage string.
// The argument p points to an int16 variable in which to store the value of the flag.
func
(
f
*
FlagSet
)
Int16Var
(
p
*
int16
,
name
string
,
value
int16
,
usage
string
)
{
f
.
VarP
(
newInt16Value
(
value
,
p
),
name
,
""
,
usage
)
}
// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int16VarP
(
p
*
int16
,
name
,
shorthand
string
,
value
int16
,
usage
string
)
{
f
.
VarP
(
newInt16Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
// Int16Var defines an int16 flag with specified name, default value, and usage string.
// The argument p points to an int16 variable in which to store the value of the flag.
func
Int16Var
(
p
*
int16
,
name
string
,
value
int16
,
usage
string
)
{
CommandLine
.
VarP
(
newInt16Value
(
value
,
p
),
name
,
""
,
usage
)
}
// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash.
func
Int16VarP
(
p
*
int16
,
name
,
shorthand
string
,
value
int16
,
usage
string
)
{
CommandLine
.
VarP
(
newInt16Value
(
value
,
p
),
name
,
shorthand
,
usage
)
}
// Int16 defines an int16 flag with specified name, default value, and usage string.
// The return value is the address of an int16 variable that stores the value of the flag.
func
(
f
*
FlagSet
)
Int16
(
name
string
,
value
int16
,
usage
string
)
*
int16
{
p
:=
new
(
int16
)
f
.
Int16VarP
(
p
,
name
,
""
,
value
,
usage
)
return
p
}
// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash.
func
(
f
*
FlagSet
)
Int16P
(
name
,
shorthand
string
,
value
int16
,
usage
string
)
*
int16
{
p
:=
new
(
int16
)
f
.
Int16VarP
(
p
,
name
,
shorthand
,
value
,
usage
)
return
p
}
// Int16 defines an int16 flag with specified name, default value, and usage string.
// The return value is the address of an int16 variable that stores the value of the flag.
func
Int16
(
name
string
,
value
int16
,
usage
string
)
*
int16
{
return
CommandLine
.
Int16P
(
name
,
""
,
value
,
usage
)
}
// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash.
func
Int16P
(
name
,
shorthand
string
,
value
int16
,
usage
string
)
*
int16
{
return
CommandLine
.
Int16P
(
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