remove printer helpers

This commit is contained in:
juanvallejo
2018-05-01 15:48:46 -04:00
parent d7d4381961
commit 5a34e4f594
24 changed files with 286 additions and 382 deletions

View File

@@ -91,8 +91,15 @@ type ReplaceOptions struct {
}
func NewReplaceOptions(out, errOut io.Writer) *ReplaceOptions {
outputFormat := ""
return &ReplaceOptions{
PrintFlags: printers.NewPrintFlags("replaced"),
// TODO(juanvallejo): figure out why we only support the "name" outputFormat in this command
// we only support "-o name" for this command, so only register the name printer
PrintFlags: &printers.PrintFlags{
OutputFormat: &outputFormat,
NamePrintFlags: printers.NewNamePrintFlags("replaced"),
},
DeleteFlags: NewDeleteFlags("to use to replace the resource."),
Out: out,
@@ -110,7 +117,6 @@ func NewCmdReplace(f cmdutil.Factory, out, errOut io.Writer) *cobra.Command {
Long: replaceLong,
Example: replaceExample,
Run: func(cmd *cobra.Command, args []string) {
cmdutil.CheckErr(cmdutil.ValidateOutputArgs(cmd))
cmdutil.CheckErr(o.Complete(f, cmd, args))
cmdutil.CheckErr(o.Validate(cmd))
cmdutil.CheckErr(o.Run())