1
0
mirror of https://github.com/docker/compose.git synced 2025-04-08 17:05:13 +02:00

Exit without error message if user canceled command (typical scenario : ACI logs — follow and ctrl-C while querying ACI)

This commit is contained in:
Guillaume Tardif 2020-07-06 13:51:48 +02:00
parent 8ad53088a3
commit 0776e79e8e

@ -173,6 +173,11 @@ func main() {
ctx = store.WithContextStore(ctx, s)
if err = root.ExecuteContext(ctx); err != nil {
//if user canceled request, simply exit without any error message
if errors.Is(ctx.Err(), context.Canceled) {
os.Exit(130)
}
// Context should always be handled by new CLI
requiredCmd, _, _ := root.Find(os.Args[1:])
if requiredCmd != nil && isOwnCommand(requiredCmd) {