diff --git a/fleetctl/destroy.go b/fleetctl/destroy.go index 31eb919b6..4dfcaf4ce 100644 --- a/fleetctl/destroy.go +++ b/fleetctl/destroy.go @@ -46,6 +46,11 @@ func runDestroyUnits(args []string) (exit int) { return 1 } + if (len(unit) == 0) { + stderr("Units not found in registry") + return 0 + } + for _, v := range units { err := cAPI.DestroyUnit(v.Name) if err != nil { diff --git a/fleetctl/stop.go b/fleetctl/stop.go index 7ffe26254..08c070023 100644 --- a/fleetctl/stop.go +++ b/fleetctl/stop.go @@ -63,6 +63,11 @@ func runStopUnit(args []string) (exit int) { return 1 } + if (len(unit) == 0) { + stderr("Units not found in registry") + return 0 + } + stopping := make([]string, 0) for _, u := range units { if !suToGlobal(u) { diff --git a/fleetctl/unload.go b/fleetctl/unload.go index 5bdbff3be..a5d8cfa4d 100644 --- a/fleetctl/unload.go +++ b/fleetctl/unload.go @@ -47,6 +47,11 @@ func runUnloadUnit(args []string) (exit int) { return 1 } + if (len(unit) == 0) { + stderr("Units not found in registry") + return 0 + } + wait := make([]string, 0) for _, s := range units { if !suToGlobal(s) {