[lxc-devel] [lxd/master] lxc: Properly handle the --version flag

stgraber on Github lxc-bot at linuxcontainers.org
Sat Feb 10 22:42:45 UTC 2018


A non-text attachment was scrubbed...
Name: not available
Type: text/x-mailbox
Size: 354 bytes
Desc: not available
URL: <http://lists.linuxcontainers.org/pipermail/lxc-devel/attachments/20180210/d14f11cf/attachment.bin>
-------------- next part --------------
From 5b98ce0354c07eb367078b3508d5c87538f1d753 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgraber at ubuntu.com>
Date: Sat, 10 Feb 2018 17:42:24 -0500
Subject: [PATCH] lxc: Properly handle the --version flag
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Signed-off-by: Stéphane Graber <stgraber at ubuntu.com>
---
 lxc/main.go | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/lxc/main.go b/lxc/main.go
index 54c93df3b..c1c1d32c0 100644
--- a/lxc/main.go
+++ b/lxc/main.go
@@ -81,7 +81,7 @@ func run() error {
 		os.Args = []string{os.Args[0], "help", "--all"}
 	}
 
-	if shared.StringInSlice("--version", os.Args) {
+	if shared.StringInSlice("--version", os.Args) && !shared.StringInSlice("--", os.Args) {
 		os.Args = []string{os.Args[0], "version"}
 	}
 


More information about the lxc-devel mailing list