Allow resource.Builder commands to take arguments by type/name

Will allow xarg behavior to fetch resources across multiple types.
Changes 'create', 'get', 'update', 'stop', and 'delete' to output
<resourceType>/<name>.
This commit is contained in:
Clayton Coleman
2015-03-25 01:01:07 -04:00
parent a34f39aee4
commit 581d7cd789
16 changed files with 343 additions and 46 deletions

View File

@@ -71,11 +71,10 @@ func (f *Factory) NewCmdStop(out io.Writer) *cobra.Command {
r.Visit(func(info *resource.Info) error {
reaper, err := f.Reaper(info.Mapping)
cmdutil.CheckErr(err)
s, err := reaper.Stop(info.Namespace, info.Name)
if err != nil {
if _, err := reaper.Stop(info.Namespace, info.Name); err != nil {
return err
}
fmt.Fprintf(out, "%s\n", s)
fmt.Fprintf(out, "%s/%s\n", info.Mapping.Resource, info.Name)
return nil
})
},