Simplify the output in AfterPrint()

- Change FinishPrint() to AfterPrint()
  (As suggested in #31160)
- add a newline to separate it from the table
- remove the "objects" and ()
- assume plural
This commit is contained in:
Angus Salkeld
2016-09-06 11:42:30 +10:00
parent 7c27a2686f
commit ee298a80e9
5 changed files with 18 additions and 18 deletions

View File

@@ -235,7 +235,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
if err := printer.PrintObj(obj, out); err != nil {
return fmt.Errorf("unable to output the provided object: %v", err)
}
printer.FinishPrint(errOut, mapping.Resource)
printer.AfterPrint(errOut, mapping.Resource)
}
// print watched changes
@@ -253,7 +253,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
}
err := printer.PrintObj(e.Object, out)
if err == nil {
printer.FinishPrint(errOut, mapping.Resource)
printer.AfterPrint(errOut, mapping.Resource)
}
return err
})
@@ -315,7 +315,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
if err := printer.PrintObj(obj, out); err != nil {
allErrs = append(allErrs, err)
}
printer.FinishPrint(errOut, res)
printer.AfterPrint(errOut, res)
return utilerrors.NewAggregate(allErrs)
}
@@ -382,7 +382,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
if printer == nil || lastMapping == nil || mapping == nil || mapping.Resource != lastMapping.Resource {
if printer != nil {
w.Flush()
printer.FinishPrint(errOut, lastMapping.Resource)
printer.AfterPrint(errOut, lastMapping.Resource)
}
printer, err = f.PrinterForMapping(cmd, mapping, allNamespaces)
if err != nil {
@@ -422,7 +422,7 @@ func RunGet(f *cmdutil.Factory, out io.Writer, errOut io.Writer, cmd *cobra.Comm
}
w.Flush()
if printer != nil {
printer.FinishPrint(errOut, lastMapping.Resource)
printer.AfterPrint(errOut, lastMapping.Resource)
}
return utilerrors.NewAggregate(allErrs)
}