Print resource labels as columns
This commit is contained in:
@@ -15,6 +15,7 @@ limitations under the License.
|
||||
*/
|
||||
|
||||
// A set of common functions needed by cmd/kubectl and pkg/kubectl packages.
|
||||
|
||||
package kubectl
|
||||
|
||||
import (
|
||||
@@ -38,3 +39,15 @@ func AddJsonFilenameFlag(cmd *cobra.Command, value *util.StringList, usage strin
|
||||
}
|
||||
cmd.Flags().AddFlag(flag)
|
||||
}
|
||||
|
||||
// AddLabelsToColumnsFlag added a user flag to print resource labels into columns. Currently used in kubectl get command
|
||||
func AddLabelsToColumnsFlag(cmd *cobra.Command, value *util.StringList, usage string) {
|
||||
flag := &pflag.Flag{
|
||||
Name: "label-columns",
|
||||
Shorthand: "L",
|
||||
Usage: usage,
|
||||
Value: value,
|
||||
DefValue: value.String(),
|
||||
}
|
||||
cmd.Flags().AddFlag(flag)
|
||||
}
|
||||
|
Reference in New Issue
Block a user