Skip to content
This repository has been archived by the owner on May 8, 2023. It is now read-only.

Only select running processes when stopping all. #157

Merged
merged 3 commits into from
Jun 16, 2018
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
7 changes: 5 additions & 2 deletions edward/stop.go
Original file line number Diff line number Diff line change
Expand Up @@ -9,13 +9,16 @@ import (
)

func (c *Client) Stop(names []string, force bool, exclude []string, all bool) error {
sgs, err := c.getServiceList(names, all)

// Prompt user to confirm as needed
if len(names) == 0 && !force && !c.askForConfirmation("Are you sure you want to stop all services?") {
return nil
}

sgs, err := c.getServiceList(names, all || len(names) == 0)
if err != nil {
return errors.WithStack(err)
}

// Perform required checks and actions for services
if c.ServiceChecks != nil {
if err = c.ServiceChecks(sgs); err != nil {
Expand Down