Commit 90bc5565 authored by Saad Ali's avatar Saad Ali

Merge pull request #12812 from eparis/more-pflag-updates

Use more pflag functions instead of writing it ourselves.
parents 2f1edf7d 7162baa4
...@@ -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",
......
...@@ -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)
}
} }
} }
} }
......
...@@ -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())
} }
...@@ -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)
}
...@@ -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
} }
......
...@@ -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)
} }
// Like BoolVar, but accepts a shorthand letter that can be used after a single dash. // BoolVarP is like 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)
} }
// Like BoolVar, but accepts a shorthand letter that can be used after a single dash. // BoolVarP is like 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)
} }
// Like Bool, but accepts a shorthand letter that can be used after a single dash. // BoolP is like 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)
} }
// Like Bool, but accepts a shorthand letter that can be used after a single dash. // BoolP is like 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
......
...@@ -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)
} }
...@@ -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)
} }
// Like DurationVar, but accepts a shorthand letter that can be used after a single dash. // DurationVarP is like 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)
} }
// Like DurationVar, but accepts a shorthand letter that can be used after a single dash. // DurationVarP is like 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
} }
// Like Duration, but accepts a shorthand letter that can be used after a single dash. // DurationP is like 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)
} }
// Like Duration, but accepts a shorthand letter that can be used after a single dash. // DurationP is like 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)
} }
...@@ -19,15 +19,15 @@ import ( ...@@ -19,15 +19,15 @@ import (
) )
var ( var (
test_bool = Bool("test_bool", false, "bool value") testBool = Bool("test_bool", false, "bool value")
test_int = Int("test_int", 0, "int value") testInt = Int("test_int", 0, "int value")
test_int64 = Int64("test_int64", 0, "int64 value") testInt64 = Int64("test_int64", 0, "int64 value")
test_uint = Uint("test_uint", 0, "uint value") testUint = Uint("test_uint", 0, "uint value")
test_uint64 = Uint64("test_uint64", 0, "uint64 value") testUint64 = Uint64("test_uint64", 0, "uint64 value")
test_string = String("test_string", "0", "string value") testString = String("test_string", "0", "string value")
test_float64 = Float64("test_float64", 0, "float64 value") testFloat = Float64("test_float64", 0, "float64 value")
test_duration = Duration("test_duration", 0, "time.Duration value") testDuration = Duration("test_duration", 0, "time.Duration value")
test_optional_int = Int("test_optional_int", 0, "optional int value") testOptionalInt = 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)
......
...@@ -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)
} }
// Like Float32Var, but accepts a shorthand letter that can be used after a single dash. // Float32VarP is like 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)
} }
// Like Float32Var, but accepts a shorthand letter that can be used after a single dash. // Float32VarP is like 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
} }
// Like Float32, but accepts a shorthand letter that can be used after a single dash. // Float32P is like 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)
} }
// Like Float32, but accepts a shorthand letter that can be used after a single dash. // Float32P is like 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)
} }
...@@ -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)
} }
// Like Float64Var, but accepts a shorthand letter that can be used after a single dash. // Float64VarP is like 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)
} }
// Like Float64Var, but accepts a shorthand letter that can be used after a single dash. // Float64VarP is like 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
} }
// Like Float64, but accepts a shorthand letter that can be used after a single dash. // Float64P is like 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)
} }
// Like Float64, but accepts a shorthand letter that can be used after a single dash. // Float64P is like 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)
} }
// 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)
})
}
// 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)
}
}
...@@ -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)
} }
// Like IntVar, but accepts a shorthand letter that can be used after a single dash. // IntVarP is like 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)
} }
// Like IntVar, but accepts a shorthand letter that can be used after a single dash. // IntVarP is like 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
} }
// Like Int, but accepts a shorthand letter that can be used after a single dash. // IntP is like 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)
} }
// Like Int, but accepts a shorthand letter that can be used after a single dash. // IntP is like 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)
} }
...@@ -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)
} }
// Like Int32Var, but accepts a shorthand letter that can be used after a single dash. // Int32VarP is like 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)
} }
// Like Int32Var, but accepts a shorthand letter that can be used after a single dash. // Int32VarP is like 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
} }
// Like Int32, but accepts a shorthand letter that can be used after a single dash. // Int32P is like 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)
} }
// Like Int32, but accepts a shorthand letter that can be used after a single dash. // Int32P is like 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)
} }
...@@ -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)
} }
// Like Int64Var, but accepts a shorthand letter that can be used after a single dash. // Int64VarP is like 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)
} }
// Like Int64Var, but accepts a shorthand letter that can be used after a single dash. // Int64VarP is like 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
} }
// Like Int64, but accepts a shorthand letter that can be used after a single dash. // Int64P is like 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)
} }
// Like Int64, but accepts a shorthand letter that can be used after a single dash. // Int64P is like 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)
} }
...@@ -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)
} }
// Like Int8Var, but accepts a shorthand letter that can be used after a single dash. // Int8VarP is like 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)
} }
// Like Int8Var, but accepts a shorthand letter that can be used after a single dash. // Int8VarP is like 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
} }
// Like Int8, but accepts a shorthand letter that can be used after a single dash. // Int8P is like 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)
} }
// Like Int8, but accepts a shorthand letter that can be used after a single dash. // Int8P is like 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)
} }
...@@ -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)
} }
// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. // IntSliceVarP is like 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)
} }
// Like IntSliceVar, but accepts a shorthand letter that can be used after a single dash. // IntSliceVarP is like 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
} }
// Like IntSlice, but accepts a shorthand letter that can be used after a single dash. // IntSliceP is like 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)
} }
// Like IntSlice, but accepts a shorthand letter that can be used after a single dash. // IntSliceP is like 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)
} }
...@@ -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 seperated list!") f.IntSliceVar(isp, "is", []int{}, "Command separated 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 seperated list!") f.IntSliceVar(isp, "is", []int{0, 1}, "Command separated 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)
} }
} }
} }
...@@ -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)
} }
// Like IPVar, but accepts a shorthand letter that can be used after a single dash. // IPVarP is like 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)
} }
// Like IPVar, but accepts a shorthand letter that can be used after a single dash. // IPVarP is like 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
} }
// Like IP, but accepts a shorthand letter that can be used after a single dash. // IPP is like 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)
} }
// Like IP, but accepts a shorthand letter that can be used after a single dash. // IPP is like 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)
} }
...@@ -28,7 +28,7 @@ func (i *ipMaskValue) Type() string { ...@@ -28,7 +28,7 @@ func (i *ipMaskValue) Type() string {
return "ipMask" return "ipMask"
} }
// Parse IPv4 netmask written in IP form (e.g. 255.255.255.0). // ParseIPv4Mask 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)
} }
// Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. // IPMaskVarP is like 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)
} }
// Like IPMaskVar, but accepts a shorthand letter that can be used after a single dash. // IPMaskVarP is like 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
} }
// Like IPMask, but accepts a shorthand letter that can be used after a single dash. // IPMaskP is like 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)
} }
// Like IP, but accepts a shorthand letter that can be used after a single dash. // IPMaskP is like 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)
} }
...@@ -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 IPNetValue net.IPNet type ipNetValue net.IPNet
func (ipnet IPNetValue) String() string { func (ipnet ipNetValue) String() string {
n := net.IPNet(ipnet) n := net.IPNet(ipnet)
return n.String() return n.String()
} }
func (ipnet *IPNetValue) Set(value string) error { func (ipnet *ipNetValue) 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 = IPNetValue(*n) *ipnet = ipNetValue(*n)
return nil return nil
} }
func (*IPNetValue) Type() string { func (*ipNetValue) Type() string {
return "ipNet" return "ipNet"
} }
var _ = strings.TrimSpace var _ = strings.TrimSpace
func newIPNetValue(val net.IPNet, p *net.IPNet) *IPNetValue { func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {
*p = val *p = val
return (*IPNetValue)(p) return (*ipNetValue)(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)
} }
// Like IPNetVar, but accepts a shorthand letter that can be used after a single dash. // IPNetVarP is like 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)
} }
// Like IPNetVar, but accepts a shorthand letter that can be used after a single dash. // IPNetVarP is like 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
} }
// Like IPNet, but accepts a shorthand letter that can be used after a single dash. // IPNetP is like 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)
} }
// Like IPNet, but accepts a shorthand letter that can be used after a single dash. // IPNetP is like 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)
} }
...@@ -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)
} }
// Like StringVar, but accepts a shorthand letter that can be used after a single dash. // StringVarP is like 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)
} }
// Like StringVar, but accepts a shorthand letter that can be used after a single dash. // StringVarP is like 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
} }
// Like String, but accepts a shorthand letter that can be used after a single dash. // StringP is like 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)
} }
// Like String, but accepts a shorthand letter that can be used after a single dash. // StringP is like 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)
} }
...@@ -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)
} }
// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. // StringSliceVarP is like 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)
} }
// Like StringSliceVar, but accepts a shorthand letter that can be used after a single dash. // StringSliceVarP is like 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
} }
// Like StringSlice, but accepts a shorthand letter that can be used after a single dash. // StringSliceP is like 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)
} }
// Like StringSlice, but accepts a shorthand letter that can be used after a single dash. // StringSliceP is like 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)
} }
...@@ -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 seperated list!") f.StringSliceVar(ssp, "ss", []string{}, "Command separated 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 seperated list!") f.StringSliceVar(ssp, "ss", []string{"default", "values"}, "Command separated list!")
return f return f
} }
......
...@@ -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)
} }
// Like UintVar, but accepts a shorthand letter that can be used after a single dash. // UintVarP is like 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)
} }
// Like UintVar, but accepts a shorthand letter that can be used after a single dash. // UintVarP is like 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
} }
// Like Uint, but accepts a shorthand letter that can be used after a single dash. // UintP is like 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)
} }
// Like Uint, but accepts a shorthand letter that can be used after a single dash. // UintP is like 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)
} }
...@@ -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)
} }
// Like Uint16Var, but accepts a shorthand letter that can be used after a single dash. // Uint16VarP is like 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)
} }
// Like Uint16Var, but accepts a shorthand letter that can be used after a single dash. // Uint16VarP is like 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
} }
// Like Uint16, but accepts a shorthand letter that can be used after a single dash. // Uint16P is like 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)
} }
// Like Uint16, but accepts a shorthand letter that can be used after a single dash. // Uint16P is like 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)
} }
...@@ -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)
} }
// Like Uint32Var, but accepts a shorthand letter that can be used after a single dash. // Uint32VarP is like 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)
} }
// Like Uint32Var, but accepts a shorthand letter that can be used after a single dash. // Uint32VarP is like 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
} }
// Like Uint32, but accepts a shorthand letter that can be used after a single dash. // Uint32P is like 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)
} }
// Like Uint32, but accepts a shorthand letter that can be used after a single dash. // Uint32P is like 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)
} }
...@@ -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)
} }
// Like Uint64Var, but accepts a shorthand letter that can be used after a single dash. // Uint64VarP is like 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)
} }
// Like Uint64Var, but accepts a shorthand letter that can be used after a single dash. // Uint64VarP is like 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
} }
// Like Uint64, but accepts a shorthand letter that can be used after a single dash. // Uint64P is like 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)
} }
// Like Uint64, but accepts a shorthand letter that can be used after a single dash. // Uint64P is like 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)
} }
...@@ -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)
} }
// Like Uint8Var, but accepts a shorthand letter that can be used after a single dash. // Uint8VarP is like 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)
} }
// Like Uint8Var, but accepts a shorthand letter that can be used after a single dash. // Uint8VarP is like 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
} }
// Like Uint8, but accepts a shorthand letter that can be used after a single dash. // Uint8P is like 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)
} }
// Like Uint8, but accepts a shorthand letter that can be used after a single dash. // Uint8P is like 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)
} }
...@@ -77,8 +77,8 @@ func (hk *HyperKube) Flags() *pflag.FlagSet { ...@@ -77,8 +77,8 @@ func (hk *HyperKube) Flags() *pflag.FlagSet {
// These will add all of the "global" flags (defined with both the // These will add all of the "global" flags (defined with both the
// flag and pflag packages) to the new flag set we have. // flag and pflag packages) to the new flag set we have.
util.AddFlagSetToPFlagSet(flag.CommandLine, hk.baseFlags) hk.baseFlags.AddGoFlagSet(flag.CommandLine)
util.AddPFlagSetToPFlagSet(pflag.CommandLine, hk.baseFlags) hk.baseFlags.AddFlagSet(pflag.CommandLine)
} }
return hk.baseFlags return hk.baseFlags
...@@ -154,7 +154,7 @@ func (hk *HyperKube) Run(args []string) error { ...@@ -154,7 +154,7 @@ func (hk *HyperKube) Run(args []string) error {
return err return err
} }
util.AddPFlagSetToPFlagSet(hk.Flags(), s.Flags()) s.Flags().AddFlagSet(hk.Flags())
err = s.Flags().Parse(args) err = s.Flags().Parse(args)
if err != nil || hk.helpFlagVal { if err != nil || hk.helpFlagVal {
if err != nil { if err != nil {
......
...@@ -126,7 +126,7 @@ func TestServerHelp(t *testing.T) { ...@@ -126,7 +126,7 @@ func TestServerHelp(t *testing.T) {
x := runFull(t, "hyperkube test1 --help") x := runFull(t, "hyperkube test1 --help")
assert.NoError(t, x.err) assert.NoError(t, x.err)
assert.Contains(t, x.output, "A simple server named test1") assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help=false: help for hyperkube") assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.NotContains(t, x.output, "test1 Run") assert.NotContains(t, x.output, "test1 Run")
} }
...@@ -134,7 +134,7 @@ func TestServerFlagsBad(t *testing.T) { ...@@ -134,7 +134,7 @@ func TestServerFlagsBad(t *testing.T) {
x := runFull(t, "hyperkube test1 --bad-flag") x := runFull(t, "hyperkube test1 --bad-flag")
assert.EqualError(t, x.err, "unknown flag: --bad-flag") assert.EqualError(t, x.err, "unknown flag: --bad-flag")
assert.Contains(t, x.output, "A simple server named test1") assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help=false: help for hyperkube") assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.NotContains(t, x.output, "test1 Run") assert.NotContains(t, x.output, "test1 Run")
} }
......
...@@ -82,6 +82,12 @@ __handle_filename_extension_flag() ...@@ -82,6 +82,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]}"
......
...@@ -75,8 +75,8 @@ func (hk *HyperKube) Flags() *pflag.FlagSet { ...@@ -75,8 +75,8 @@ func (hk *HyperKube) Flags() *pflag.FlagSet {
// These will add all of the "global" flags (defined with both the // These will add all of the "global" flags (defined with both the
// flag and pflag packages) to the new flag set we have. // flag and pflag packages) to the new flag set we have.
util.AddFlagSetToPFlagSet(flag.CommandLine, hk.baseFlags) hk.baseFlags.AddGoFlagSet(flag.CommandLine)
util.AddPFlagSetToPFlagSet(pflag.CommandLine, hk.baseFlags) hk.baseFlags.AddFlagSet(pflag.CommandLine)
} }
return hk.baseFlags return hk.baseFlags
...@@ -152,7 +152,7 @@ func (hk *HyperKube) Run(args []string) error { ...@@ -152,7 +152,7 @@ func (hk *HyperKube) Run(args []string) error {
return err return err
} }
util.AddPFlagSetToPFlagSet(hk.Flags(), s.Flags()) s.Flags().AddFlagSet(hk.Flags())
err = s.Flags().Parse(args) err = s.Flags().Parse(args)
if err != nil || hk.helpFlagVal { if err != nil || hk.helpFlagVal {
if err != nil { if err != nil {
......
...@@ -125,7 +125,7 @@ func TestServerHelp(t *testing.T) { ...@@ -125,7 +125,7 @@ func TestServerHelp(t *testing.T) {
x := runFull(t, "hyperkube test1 --help") x := runFull(t, "hyperkube test1 --help")
assert.NoError(t, x.err) assert.NoError(t, x.err)
assert.Contains(t, x.output, "A simple server named test1") assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help=false: help for hyperkube") assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.NotContains(t, x.output, "test1 Run") assert.NotContains(t, x.output, "test1 Run")
} }
...@@ -133,7 +133,7 @@ func TestServerFlagsBad(t *testing.T) { ...@@ -133,7 +133,7 @@ func TestServerFlagsBad(t *testing.T) {
x := runFull(t, "hyperkube test1 --bad-flag") x := runFull(t, "hyperkube test1 --bad-flag")
assert.EqualError(t, x.err, "unknown flag: --bad-flag") assert.EqualError(t, x.err, "unknown flag: --bad-flag")
assert.Contains(t, x.output, "A simple server named test1") assert.Contains(t, x.output, "A simple server named test1")
assert.Contains(t, x.output, "--help=false: help for hyperkube") assert.Contains(t, x.output, "--help[=false]: help for hyperkube")
assert.NotContains(t, x.output, "test1 Run") assert.NotContains(t, x.output, "test1 Run")
} }
......
...@@ -49,7 +49,7 @@ kubectl ...@@ -49,7 +49,7 @@ kubectl
### Options ### Options
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -60,9 +60,9 @@ kubectl ...@@ -60,9 +60,9 @@ kubectl
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -102,7 +102,7 @@ kubectl ...@@ -102,7 +102,7 @@ kubectl
* [kubectl stop](kubectl_stop.md) - Deprecated: Gracefully shut down a resource by name or filename. * [kubectl stop](kubectl_stop.md) - Deprecated: Gracefully shut down a resource by name or filename.
* [kubectl version](kubectl_version.md) - Print the client and server version information. * [kubectl version](kubectl_version.md) - Print the client and server version information.
###### Auto generated by spf13/cobra at 2015-08-12 21:51:38.841032313 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.481555644 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl.md?pixel)]()
......
...@@ -93,7 +93,7 @@ $ kubectl annotate pods foo description- ...@@ -93,7 +93,7 @@ $ kubectl annotate pods foo description-
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -103,9 +103,9 @@ $ kubectl annotate pods foo description- ...@@ -103,9 +103,9 @@ $ kubectl annotate pods foo description-
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -123,7 +123,7 @@ $ kubectl annotate pods foo description- ...@@ -123,7 +123,7 @@ $ kubectl annotate pods foo description-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-13 08:45:23.477684199 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.4790376 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_annotate.md?pixel)]()
......
...@@ -53,7 +53,7 @@ kubectl api-versions ...@@ -53,7 +53,7 @@ kubectl api-versions
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -63,9 +63,9 @@ kubectl api-versions ...@@ -63,9 +63,9 @@ kubectl api-versions
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -83,7 +83,7 @@ kubectl api-versions ...@@ -83,7 +83,7 @@ kubectl api-versions
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-07 07:32:08.138043968 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.481201276 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_api-versions.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_api-versions.md?pixel)]()
......
...@@ -70,7 +70,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t ...@@ -70,7 +70,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -80,9 +80,9 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t ...@@ -80,9 +80,9 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -100,7 +100,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t ...@@ -100,7 +100,7 @@ $ kubectl attach 123456-7890 -c ruby-container -i -t
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.552121602 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477447179 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_attach.md?pixel)]()
......
...@@ -53,7 +53,7 @@ kubectl cluster-info ...@@ -53,7 +53,7 @@ kubectl cluster-info
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -63,9 +63,9 @@ kubectl cluster-info ...@@ -63,9 +63,9 @@ kubectl cluster-info
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -83,7 +83,7 @@ kubectl cluster-info ...@@ -83,7 +83,7 @@ kubectl cluster-info
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.877534441 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.481057477 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cluster-info.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_cluster-info.md?pixel)]()
......
...@@ -60,7 +60,7 @@ kubectl config SUBCOMMAND ...@@ -60,7 +60,7 @@ kubectl config SUBCOMMAND
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -69,9 +69,9 @@ kubectl config SUBCOMMAND ...@@ -69,9 +69,9 @@ kubectl config SUBCOMMAND
--context="": The name of the kubeconfig context to use --context="": The name of the kubeconfig context to use
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -96,7 +96,7 @@ kubectl config SUBCOMMAND ...@@ -96,7 +96,7 @@ kubectl config SUBCOMMAND
* [kubectl config use-context](kubectl_config_use-context.md) - Sets the current-context in a kubeconfig file * [kubectl config use-context](kubectl_config_use-context.md) - Sets the current-context in a kubeconfig file
* [kubectl config view](kubectl_config_view.md) - displays Merged kubeconfig settings or a specified kubeconfig file. * [kubectl config view](kubectl_config_view.md) - displays Merged kubeconfig settings or a specified kubeconfig file.
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.877353612 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480913444 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config.md?pixel)]()
......
...@@ -61,27 +61,27 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true ...@@ -61,27 +61,27 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
### Options ### Options
``` ```
--api-version=: api-version for the cluster entry in kubeconfig --api-version="": api-version for the cluster entry in kubeconfig
--certificate-authority=: path to certificate-authority for the cluster entry in kubeconfig --certificate-authority="": path to certificate-authority for the cluster entry in kubeconfig
--embed-certs=false: embed-certs for the cluster entry in kubeconfig --embed-certs=false: embed-certs for the cluster entry in kubeconfig
-h, --help[=false]: help for set-cluster -h, --help[=false]: help for set-cluster
--insecure-skip-tls-verify=false: insecure-skip-tls-verify for the cluster entry in kubeconfig --insecure-skip-tls-verify=false: insecure-skip-tls-verify for the cluster entry in kubeconfig
--server=: server for the cluster entry in kubeconfig --server="": server for the cluster entry in kubeconfig
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
--client-key="": Path to a client key file for TLS. --client-key="": Path to a client key file for TLS.
--cluster="": The name of the kubeconfig cluster to use --cluster="": The name of the kubeconfig cluster to use
--context="": The name of the kubeconfig context to use --context="": The name of the kubeconfig context to use
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -98,7 +98,7 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true ...@@ -98,7 +98,7 @@ $ kubectl config set-cluster e2e --insecure-skip-tls-verify=true
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.5536843 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.479946549 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-cluster.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-cluster.md?pixel)]()
......
...@@ -55,16 +55,16 @@ $ kubectl config set-context gce --user=cluster-admin ...@@ -55,16 +55,16 @@ $ kubectl config set-context gce --user=cluster-admin
### Options ### Options
``` ```
--cluster=: cluster for the context entry in kubeconfig --cluster="": cluster for the context entry in kubeconfig
-h, --help[=false]: help for set-context -h, --help[=false]: help for set-context
--namespace=: namespace for the context entry in kubeconfig --namespace="": namespace for the context entry in kubeconfig
--user=: user for the context entry in kubeconfig --user="": user for the context entry in kubeconfig
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -73,9 +73,9 @@ $ kubectl config set-context gce --user=cluster-admin ...@@ -73,9 +73,9 @@ $ kubectl config set-context gce --user=cluster-admin
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
-s, --server="": The address and port of the Kubernetes API server -s, --server="": The address and port of the Kubernetes API server
...@@ -91,7 +91,7 @@ $ kubectl config set-context gce --user=cluster-admin ...@@ -91,7 +91,7 @@ $ kubectl config set-context gce --user=cluster-admin
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.553957807 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480303261 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-context.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-context.md?pixel)]()
......
...@@ -74,19 +74,19 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi ...@@ -74,19 +74,19 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
### Options ### Options
``` ```
--client-certificate=: path to client-certificate for the user entry in kubeconfig --client-certificate="": path to client-certificate for the user entry in kubeconfig
--client-key=: path to client-key for the user entry in kubeconfig --client-key="": path to client-key for the user entry in kubeconfig
--embed-certs=false: embed client cert/key for the user entry in kubeconfig --embed-certs=false: embed client cert/key for the user entry in kubeconfig
-h, --help[=false]: help for set-credentials -h, --help[=false]: help for set-credentials
--password=: password for the user entry in kubeconfig --password="": password for the user entry in kubeconfig
--token=: token for the user entry in kubeconfig --token="": token for the user entry in kubeconfig
--username=: username for the user entry in kubeconfig --username="": username for the user entry in kubeconfig
``` ```
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--cluster="": The name of the kubeconfig cluster to use --cluster="": The name of the kubeconfig cluster to use
...@@ -94,9 +94,9 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi ...@@ -94,9 +94,9 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
-s, --server="": The address and port of the Kubernetes API server -s, --server="": The address and port of the Kubernetes API server
...@@ -111,7 +111,7 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi ...@@ -111,7 +111,7 @@ $ kubectl config set-credentials cluster-admin --client-certificate=~/.kube/admi
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.553818643 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480107057 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-credentials.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set-credentials.md?pixel)]()
......
...@@ -55,7 +55,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE ...@@ -55,7 +55,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -65,9 +65,9 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE ...@@ -65,9 +65,9 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -85,7 +85,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE ...@@ -85,7 +85,7 @@ kubectl config set PROPERTY_NAME PROPERTY_VALUE
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.876800013 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480452342 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_set.md?pixel)]()
......
...@@ -54,7 +54,7 @@ kubectl config unset PROPERTY_NAME ...@@ -54,7 +54,7 @@ kubectl config unset PROPERTY_NAME
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -64,9 +64,9 @@ kubectl config unset PROPERTY_NAME ...@@ -64,9 +64,9 @@ kubectl config unset PROPERTY_NAME
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -84,7 +84,7 @@ kubectl config unset PROPERTY_NAME ...@@ -84,7 +84,7 @@ kubectl config unset PROPERTY_NAME
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.876989795 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480598704 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_unset.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_unset.md?pixel)]()
......
...@@ -53,7 +53,7 @@ kubectl config use-context CONTEXT_NAME ...@@ -53,7 +53,7 @@ kubectl config use-context CONTEXT_NAME
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -63,9 +63,9 @@ kubectl config use-context CONTEXT_NAME ...@@ -63,9 +63,9 @@ kubectl config use-context CONTEXT_NAME
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -83,7 +83,7 @@ kubectl config use-context CONTEXT_NAME ...@@ -83,7 +83,7 @@ kubectl config use-context CONTEXT_NAME
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.877169143 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.480752945 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_use-context.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_use-context.md?pixel)]()
......
...@@ -75,7 +75,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2 ...@@ -75,7 +75,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -85,9 +85,9 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2 ...@@ -85,9 +85,9 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": use a particular kubeconfig file --kubeconfig="": use a particular kubeconfig file
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -105,7 +105,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2 ...@@ -105,7 +105,7 @@ $ kubectl config view -o template --template='{{range .users}}{{ if eq .name "e2
* [kubectl config](kubectl_config.md) - config modifies kubeconfig files * [kubectl config](kubectl_config.md) - config modifies kubeconfig files
###### Auto generated by spf13/cobra at 2015-08-13 08:45:23.478129098 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.479773286 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_config_view.md?pixel)]()
......
...@@ -67,7 +67,7 @@ $ cat pod.json | kubectl create -f - ...@@ -67,7 +67,7 @@ $ cat pod.json | kubectl create -f -
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -77,9 +77,9 @@ $ cat pod.json | kubectl create -f - ...@@ -77,9 +77,9 @@ $ cat pod.json | kubectl create -f -
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -97,7 +97,7 @@ $ cat pod.json | kubectl create -f - ...@@ -97,7 +97,7 @@ $ cat pod.json | kubectl create -f -
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.550238308 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475503857 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_create.md?pixel)]()
......
...@@ -88,7 +88,7 @@ $ kubectl delete pods --all ...@@ -88,7 +88,7 @@ $ kubectl delete pods --all
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -98,9 +98,9 @@ $ kubectl delete pods --all ...@@ -98,9 +98,9 @@ $ kubectl delete pods --all
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -118,7 +118,7 @@ $ kubectl delete pods --all ...@@ -118,7 +118,7 @@ $ kubectl delete pods --all
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.550716188 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.476048394 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_delete.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_delete.md?pixel)]()
......
...@@ -91,7 +91,7 @@ $ kubectl describe pods frontend ...@@ -91,7 +91,7 @@ $ kubectl describe pods frontend
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -101,9 +101,9 @@ $ kubectl describe pods frontend ...@@ -101,9 +101,9 @@ $ kubectl describe pods frontend
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -121,7 +121,7 @@ $ kubectl describe pods frontend ...@@ -121,7 +121,7 @@ $ kubectl describe pods frontend
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 17:00:51.070612795 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475314072 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_describe.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_describe.md?pixel)]()
......
...@@ -71,7 +71,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il ...@@ -71,7 +71,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -81,9 +81,9 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il ...@@ -81,9 +81,9 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -101,7 +101,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il ...@@ -101,7 +101,7 @@ $ kubectl exec 123456-7890 -c ruby-container -i -t -- bash -il
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.552259405 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477614406 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_exec.md?pixel)]()
......
...@@ -94,7 +94,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream ...@@ -94,7 +94,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -104,9 +104,9 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream ...@@ -104,9 +104,9 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -124,7 +124,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream ...@@ -124,7 +124,7 @@ $ kubectl expose rc streamer --port=4100 --protocol=udp --name=video-stream
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-13 08:45:23.476872373 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.478645014 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_expose.md?pixel)]()
......
...@@ -101,7 +101,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7 ...@@ -101,7 +101,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -111,9 +111,9 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7 ...@@ -111,9 +111,9 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -131,7 +131,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7 ...@@ -131,7 +131,7 @@ $ kubectl get rc/web service/frontend pods/web-pod-13je7
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 01:10:19.603989785 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475080519 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_get.md?pixel)]()
......
...@@ -91,7 +91,7 @@ $ kubectl label pods foo bar- ...@@ -91,7 +91,7 @@ $ kubectl label pods foo bar-
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -101,9 +101,9 @@ $ kubectl label pods foo bar- ...@@ -101,9 +101,9 @@ $ kubectl label pods foo bar-
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -121,7 +121,7 @@ $ kubectl label pods foo bar- ...@@ -121,7 +121,7 @@ $ kubectl label pods foo bar-
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 01:10:19.61318045 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.478848071 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_label.md?pixel)]()
......
...@@ -70,7 +70,7 @@ $ kubectl logs -f 123456-7890 ruby-container ...@@ -70,7 +70,7 @@ $ kubectl logs -f 123456-7890 ruby-container
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -80,9 +80,9 @@ $ kubectl logs -f 123456-7890 ruby-container ...@@ -80,9 +80,9 @@ $ kubectl logs -f 123456-7890 ruby-container
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -100,7 +100,7 @@ $ kubectl logs -f 123456-7890 ruby-container ...@@ -100,7 +100,7 @@ $ kubectl logs -f 123456-7890 ruby-container
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.55101853 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.476847461 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_logs.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_logs.md?pixel)]()
......
...@@ -56,7 +56,7 @@ kubectl namespace [namespace] ...@@ -56,7 +56,7 @@ kubectl namespace [namespace]
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -66,9 +66,9 @@ kubectl namespace [namespace] ...@@ -66,9 +66,9 @@ kubectl namespace [namespace]
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -86,7 +86,7 @@ kubectl namespace [namespace] ...@@ -86,7 +86,7 @@ kubectl namespace [namespace]
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.872853909 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.476203071 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_namespace.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_namespace.md?pixel)]()
......
...@@ -74,7 +74,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve ...@@ -74,7 +74,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -84,9 +84,9 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve ...@@ -84,9 +84,9 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -104,7 +104,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve ...@@ -104,7 +104,7 @@ kubectl patch pod valid-pod -p '{"spec":{"containers":[{"name":"kubernetes-serve
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-13 02:12:21.577994505 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475848256 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_patch.md?pixel)]()
......
...@@ -71,7 +71,7 @@ $ kubectl port-forward mypod 0:5000 ...@@ -71,7 +71,7 @@ $ kubectl port-forward mypod 0:5000
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -81,9 +81,9 @@ $ kubectl port-forward mypod 0:5000 ...@@ -81,9 +81,9 @@ $ kubectl port-forward mypod 0:5000
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -101,7 +101,7 @@ $ kubectl port-forward mypod 0:5000 ...@@ -101,7 +101,7 @@ $ kubectl port-forward mypod 0:5000
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.552397633 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.47778769 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_port-forward.md?pixel)]()
......
...@@ -93,7 +93,7 @@ $ kubectl proxy --api-prefix=/k8s-api ...@@ -93,7 +93,7 @@ $ kubectl proxy --api-prefix=/k8s-api
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -103,9 +103,9 @@ $ kubectl proxy --api-prefix=/k8s-api ...@@ -103,9 +103,9 @@ $ kubectl proxy --api-prefix=/k8s-api
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -123,7 +123,7 @@ $ kubectl proxy --api-prefix=/k8s-api ...@@ -123,7 +123,7 @@ $ kubectl proxy --api-prefix=/k8s-api
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.55255853 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477994494 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_proxy.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_proxy.md?pixel)]()
......
...@@ -81,7 +81,7 @@ kubectl replace --force -f ./pod.json ...@@ -81,7 +81,7 @@ kubectl replace --force -f ./pod.json
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -91,9 +91,9 @@ kubectl replace --force -f ./pod.json ...@@ -91,9 +91,9 @@ kubectl replace --force -f ./pod.json
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -111,7 +111,7 @@ kubectl replace --force -f ./pod.json ...@@ -111,7 +111,7 @@ kubectl replace --force -f ./pod.json
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 21:51:38.83671597 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.475684757 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_replace.md?pixel)]()
......
...@@ -89,7 +89,7 @@ $ kubectl rolling-update frontend --image=image:v2 ...@@ -89,7 +89,7 @@ $ kubectl rolling-update frontend --image=image:v2
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -99,9 +99,9 @@ $ kubectl rolling-update frontend --image=image:v2 ...@@ -99,9 +99,9 @@ $ kubectl rolling-update frontend --image=image:v2
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -119,7 +119,7 @@ $ kubectl rolling-update frontend --image=image:v2 ...@@ -119,7 +119,7 @@ $ kubectl rolling-update frontend --image=image:v2
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-20 01:10:19.606885893 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477073189 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_rolling-update.md?pixel)]()
......
...@@ -98,7 +98,7 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN> ...@@ -98,7 +98,7 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -108,9 +108,9 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN> ...@@ -108,9 +108,9 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -128,7 +128,7 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN> ...@@ -128,7 +128,7 @@ $ kubectl run nginx --image=nginx --command -- <cmd> <arg1> ... <argN>
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-14 06:15:57.11465464 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.478226341 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_run.md?pixel)]()
......
...@@ -80,7 +80,7 @@ $ kubectl scale --replicas=5 rc/foo rc/bar ...@@ -80,7 +80,7 @@ $ kubectl scale --replicas=5 rc/foo rc/bar
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -90,9 +90,9 @@ $ kubectl scale --replicas=5 rc/foo rc/bar ...@@ -90,9 +90,9 @@ $ kubectl scale --replicas=5 rc/foo rc/bar
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -110,7 +110,7 @@ $ kubectl scale --replicas=5 rc/foo rc/bar ...@@ -110,7 +110,7 @@ $ kubectl scale --replicas=5 rc/foo rc/bar
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-13 06:25:21.82766402 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.477281515 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_scale.md?pixel)]()
......
...@@ -82,7 +82,7 @@ $ kubectl stop -f path/to/resources ...@@ -82,7 +82,7 @@ $ kubectl stop -f path/to/resources
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -92,9 +92,9 @@ $ kubectl stop -f path/to/resources ...@@ -92,9 +92,9 @@ $ kubectl stop -f path/to/resources
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -112,7 +112,7 @@ $ kubectl stop -f path/to/resources ...@@ -112,7 +112,7 @@ $ kubectl stop -f path/to/resources
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-12 16:38:35.552901364 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.478408029 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_stop.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_stop.md?pixel)]()
......
...@@ -54,7 +54,7 @@ kubectl version ...@@ -54,7 +54,7 @@ kubectl version
### Options inherited from parent commands ### Options inherited from parent commands
``` ```
--alsologtostderr=false: log to standard error as well as files --alsologtostderr[=false]: log to standard error as well as files
--api-version="": The API version to use when talking to the server --api-version="": The API version to use when talking to the server
--certificate-authority="": Path to a cert. file for the certificate authority. --certificate-authority="": Path to a cert. file for the certificate authority.
--client-certificate="": Path to a client key file for TLS. --client-certificate="": Path to a client key file for TLS.
...@@ -64,9 +64,9 @@ kubectl version ...@@ -64,9 +64,9 @@ kubectl version
--insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure. --insecure-skip-tls-verify[=false]: If true, the server's certificate will not be checked for validity. This will make your HTTPS connections insecure.
--kubeconfig="": Path to the kubeconfig file to use for CLI requests. --kubeconfig="": Path to the kubeconfig file to use for CLI requests.
--log-backtrace-at=:0: when logging hits line file:N, emit a stack trace --log-backtrace-at=:0: when logging hits line file:N, emit a stack trace
--log-dir=: If non-empty, write log files in this directory --log-dir="": If non-empty, write log files in this directory
--log-flush-frequency=5s: Maximum number of seconds between log flushes --log-flush-frequency=5s: Maximum number of seconds between log flushes
--logtostderr=true: log to standard error instead of files --logtostderr[=true]: log to standard error instead of files
--match-server-version[=false]: Require server version to match client version --match-server-version[=false]: Require server version to match client version
--namespace="": If present, the namespace scope for this CLI request. --namespace="": If present, the namespace scope for this CLI request.
--password="": Password for basic authentication to the API server. --password="": Password for basic authentication to the API server.
...@@ -84,7 +84,7 @@ kubectl version ...@@ -84,7 +84,7 @@ kubectl version
* [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager * [kubectl](kubectl.md) - kubectl controls the Kubernetes cluster manager
###### Auto generated by spf13/cobra at 2015-08-05 14:22:30.877888956 +0000 UTC ###### Auto generated by spf13/cobra at 2015-08-20 22:01:12.48136046 +0000 UTC
<!-- BEGIN MUNGE: GENERATED_ANALYTICS --> <!-- BEGIN MUNGE: GENERATED_ANALYTICS -->
[![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_version.md?pixel)]() [![Analytics](https://kubernetes-site.appspot.com/UA-36037335-10/GitHub/docs/user-guide/kubectl/kubectl_version.md?pixel)]()
......
...@@ -271,11 +271,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory { ...@@ -271,11 +271,7 @@ func NewFactory(optionalClientConfig clientcmd.ClientConfig) *Factory {
// BindFlags adds any flags that are common to all kubectl sub commands. // BindFlags adds any flags that are common to all kubectl sub commands.
func (f *Factory) BindFlags(flags *pflag.FlagSet) { func (f *Factory) BindFlags(flags *pflag.FlagSet) {
// any flags defined by external projects (not part of pflags) // any flags defined by external projects (not part of pflags)
util.AddFlagSetToPFlagSet(flag.CommandLine, flags) flags.AddGoFlagSet(flag.CommandLine)
// This is necessary as github.com/spf13/cobra doesn't support "global"
// pflags currently. See https://github.com/spf13/cobra/issues/44.
util.AddPFlagSetToPFlagSet(pflag.CommandLine, flags)
// Hack for global access to validation flag. // Hack for global access to validation flag.
// TODO: Refactor out after configuration flag overhaul. // TODO: Refactor out after configuration flag overhaul.
...@@ -284,7 +280,7 @@ func (f *Factory) BindFlags(flags *pflag.FlagSet) { ...@@ -284,7 +280,7 @@ func (f *Factory) BindFlags(flags *pflag.FlagSet) {
} }
// Merge factory's flags // Merge factory's flags
util.AddPFlagSetToPFlagSet(f.flags, flags) flags.AddFlagSet(f.flags)
// Globally persistent flags across all subcommands. // Globally persistent flags across all subcommands.
// TODO Change flag names to consts to allow safer lookup from subcommands. // TODO Change flag names to consts to allow safer lookup from subcommands.
......
...@@ -16,10 +16,13 @@ limitations under the License. ...@@ -16,10 +16,13 @@ limitations under the License.
package util package util
import "strings" import (
goflag "flag"
"strings"
import "github.com/spf13/pflag" "github.com/golang/glog"
import "github.com/golang/glog" "github.com/spf13/pflag"
)
// WordSepNormalizeFunc changes all flags that contain "_" separators // WordSepNormalizeFunc changes all flags that contain "_" separators
func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName { func WordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedName {
...@@ -43,6 +46,6 @@ func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedNam ...@@ -43,6 +46,6 @@ func WarnWordSepNormalizeFunc(f *pflag.FlagSet, name string) pflag.NormalizedNam
// InitFlags normalizes and parses the command line flags // InitFlags normalizes and parses the command line flags
func InitFlags() { func InitFlags() {
pflag.CommandLine.SetNormalizeFunc(WordSepNormalizeFunc) pflag.CommandLine.SetNormalizeFunc(WordSepNormalizeFunc)
AddAllFlagsToPFlags() pflag.CommandLine.AddGoFlagSet(goflag.CommandLine)
pflag.Parse() pflag.Parse()
} }
/*
Copyright 2015 The Kubernetes Authors All rights reserved.
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
*/
package util
import (
"flag"
"reflect"
"strings"
"github.com/spf13/pflag"
)
// 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 flag.Value
flagType string
}
func wrapFlagValue(v flag.Value) pflag.Value {
// If the flag.Value happens to also be a pflag.Value, just use it directly.
if pv, ok := v.(pflag.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 = t.Name()
pv.flagType = strings.TrimSuffix(pv.flagType, "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
}
type boolFlag interface {
flag.Value
IsBoolFlag() bool
}
func (v *flagValueWrapper) IsBoolFlag() bool {
if bv, ok := v.inner.(boolFlag); ok {
return bv.IsBoolFlag()
}
return false
}
// Imports a 'flag.Flag' into a 'pflag.FlagSet'. The "short" option is unset
// and the type is inferred using reflection.
func addFlagToPFlagSet(f *flag.Flag, fs *pflag.FlagSet) {
if fs.Lookup(f.Name) == nil {
fs.Var(wrapFlagValue(f.Value), f.Name, f.Usage)
}
}
// AddFlagSetToPFlagSet adds all of the flags in a 'flag.FlagSet' package flags to a 'pflag.FlagSet'.
func AddFlagSetToPFlagSet(fsIn *flag.FlagSet, fsOut *pflag.FlagSet) {
fsIn.VisitAll(func(f *flag.Flag) {
addFlagToPFlagSet(f, fsOut)
})
}
// AddAllFlagsToPFlags adds all of the top level 'flag' package flags to the top level 'pflag' flags.
func AddAllFlagsToPFlags() {
AddFlagSetToPFlagSet(flag.CommandLine, pflag.CommandLine)
}
// AddPFlagSetToPFlagSet merges the flags of fsFrom into fsTo.
func AddPFlagSetToPFlagSet(fsFrom *pflag.FlagSet, fsTo *pflag.FlagSet) {
if fsFrom != nil && fsTo != nil {
fsFrom.VisitAll(func(f *pflag.Flag) {
if fsTo.Lookup(f.Name) == nil {
fsTo.AddFlag(f)
}
})
}
}
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment