mirror of
https://github.com/moby/moby.git
synced 2022-11-09 12:21:53 -05:00
return nil when no node or service to avoid additional api call
Signed-off-by: allencloud <allen.sun@daocloud.io>
This commit is contained in:
parent
920aa95aeb
commit
3af743bb32
3 changed files with 25 additions and 16 deletions
|
@ -58,14 +58,14 @@ func PrettyPrint(i interface{}) string {
|
|||
}
|
||||
}
|
||||
|
||||
// PromptForConfirmation request and check confirmation from user.
|
||||
// PromptForConfirmation requests and checks confirmation from user.
|
||||
// This will display the provided message followed by ' [y/N] '. If
|
||||
// the user input 'y' or 'Y' it returns true other false. If no
|
||||
// message is provided "Are you sure you want to proceeed? [y/N] "
|
||||
// message is provided "Are you sure you want to proceed? [y/N] "
|
||||
// will be used instead.
|
||||
func PromptForConfirmation(ins *InStream, outs *OutStream, message string) bool {
|
||||
if message == "" {
|
||||
message = "Are you sure you want to proceeed?"
|
||||
message = "Are you sure you want to proceed?"
|
||||
}
|
||||
message += " [y/N] "
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue