Commit f3673b8f authored by feihujiang's avatar feihujiang

Hide deprecated shorthand in man page

parent dfb400e2
...@@ -78,12 +78,16 @@ func printFlags(out *bytes.Buffer, flags *pflag.FlagSet) { ...@@ -78,12 +78,16 @@ func printFlags(out *bytes.Buffer, flags *pflag.FlagSet) {
// put quotes on the value // put quotes on the value
format = "**--%s**=%q\n\t%s\n\n" format = "**--%s**=%q\n\t%s\n\n"
} }
if len(flag.Shorthand) > 0 {
// Todo, when we mark a shorthand is deprecated, but specify an empty message.
// The flag.ShorthandDeprecated is empty as the shorthand is deprecated.
// Using len(flag.ShorthandDeprecated) > 0 can't handle this, others are ok.
if !(len(flag.ShorthandDeprecated) > 0) && len(flag.Shorthand) > 0 {
format = "**-%s**, " + format format = "**-%s**, " + format
fmt.Fprintf(out, format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)
} else { } else {
format = "%s" + format fmt.Fprintf(out, format, flag.Name, flag.DefValue, flag.Usage)
} }
fmt.Fprintf(out, format, flag.Shorthand, flag.Name, flag.DefValue, flag.Usage)
}) })
} }
......
...@@ -59,7 +59,7 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values ...@@ -59,7 +59,7 @@ You can use \-\-output=template \-\-template=TEMPLATE to extract specific values
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -62,7 +62,7 @@ to change to output destination. ...@@ -62,7 +62,7 @@ to change to output destination.
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -105,7 +105,7 @@ re\-use the labels from the resource it exposes. ...@@ -105,7 +105,7 @@ re\-use the labels from the resource it exposes.
Name or number for the port on the container that the service should direct traffic to. Optional. Name or number for the port on the container that the service should direct traffic to. Optional.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -66,7 +66,7 @@ of the \-\-template flag, you can filter the attributes of the fetched resource( ...@@ -66,7 +66,7 @@ of the \-\-template flag, you can filter the attributes of the fetched resource(
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -69,7 +69,7 @@ If \-\-resource\-version is specified, then updates will use this resource versi ...@@ -69,7 +69,7 @@ If \-\-resource\-version is specified, then updates will use this resource versi
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -73,7 +73,7 @@ existing replication controller and overwrite at least one (common) label in its ...@@ -73,7 +73,7 @@ existing replication controller and overwrite at least one (common) label in its
If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string. If non\-empty, sort list types using this field specification. The field specification is expressed as a JSONPath expression (e.g. 'ObjectMeta.Name'). The field in the API resource specified by this JSONPath expression must be an integer or a string.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -101,7 +101,7 @@ Creates a replication controller to manage the created container(s). ...@@ -101,7 +101,7 @@ Creates a replication controller to manage the created container(s).
Keep stdin open on the container(s) in the pod, even if nothing is attached. Keep stdin open on the container(s) in the pod, even if nothing is attached.
.PP .PP
\fB\-t\fP, \fB\-\-template\fP="" \fB\-\-template\fP=""
Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [ Template string or path to template file to use when \-o=go\-template, \-o=go\-template\-file. The template format is golang templates [
\[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]]. \[la]http://golang.org/pkg/text/template/#pkg-overview\[ra]].
......
...@@ -18,7 +18,7 @@ Print the client and server version information. ...@@ -18,7 +18,7 @@ Print the client and server version information.
.SH OPTIONS .SH OPTIONS
.PP .PP
\fB\-c\fP, \fB\-\-client\fP=false \fB\-\-client\fP=false
Client version only (no server required). Client version only (no server required).
......
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