The following pull request was submitted through Github.
It can be accessed and reviewed at: https://github.com/lxc/lxd/pull/6250

This e-mail was sent by the LXC bot, direct replies will not reach the author
unless they happen to be subscribed to this list.

=== Description (from pull-request) ===
Closes #6248

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
From e388884d422e548159c8f755b84a6ac9779be2f6 Mon Sep 17 00:00:00 2001
From: =?UTF-8?q?St=C3=A9phane=20Graber?= <stgra...@ubuntu.com>
Date: Thu, 26 Sep 2019 17:29:33 -0400
Subject: [PATCH] lxc: Don't print first-use on init/launch
MIME-Version: 1.0
Content-Type: text/plain; charset=UTF-8
Content-Transfer-Encoding: 8bit

Closes #6248

Signed-off-by: Stéphane Graber <stgra...@ubuntu.com>
---
 lxc/main.go | 11 ++++++++++-
 1 file changed, 10 insertions(+), 1 deletion(-)

diff --git a/lxc/main.go b/lxc/main.go
index c63d040273..b0eed20ef0 100644
--- a/lxc/main.go
+++ b/lxc/main.go
@@ -335,11 +335,20 @@ func (c *cmdGlobal) PreRun(cmd *cobra.Command, args 
[]string) error {
                        }
                }
 
+               flush := false
                if runInit {
                        fmt.Fprintf(os.Stderr, i18n.G("If this is your first 
time running LXD on this machine, you should also run: lxd init")+"\n")
+                       flush = true
                }
 
-               fmt.Fprintf(os.Stderr, i18n.G("To start your first container, 
try: lxc launch ubuntu:18.04")+"\n\n")
+               if !shared.StringInSlice(cmd.Name(), []string{"init", 
"launch"}) {
+                       fmt.Fprintf(os.Stderr, i18n.G("To start your first 
container, try: lxc launch ubuntu:18.04")+"\n")
+                       flush = true
+               }
+
+               if flush {
+                       fmt.Fprintf(os.Stderr, "\n")
+               }
        }
 
        // Set the user agent
_______________________________________________
lxc-devel mailing list
lxc-devel@lists.linuxcontainers.org
http://lists.linuxcontainers.org/listinfo/lxc-devel

Reply via email to