more explicit --rm instructions + erroring out if no --id provided

This commit is contained in:
farhansolodev
2023-04-03 22:48:57 +04:00
parent cf1e7c6d6f
commit 806b499e72
2 changed files with 10 additions and 6 deletions

View File

@@ -92,10 +92,14 @@ var CliAction = func(ctx *cli.Context) error {
}
// Function called to stop and remove server from Docker
if RemoveVM != "" && ID != "" {
err := client.RemoveContianer(RemoveVM, ID)
if err != nil {
fmt.Print(err)
if RemoveVM != "" {
if ID == "" {
fmt.Println("provide container ID via --ID or --id")
} else {
err := client.RemoveContianer(RemoveVM, ID)
if err != nil {
fmt.Print(err)
}
}
}
@@ -178,7 +182,7 @@ var CliAction = func(ctx *cli.Context) error {
fmt.Println("Success")
}
} else {
fmt.Println("provide container ID")
fmt.Println("provide container ID via --ID or --id")
}
}