There are cases when we don't want to tell the user we are connected.
That's for example when we first connect to the server without the
command 'connect' itself. That helps to clear out output of first
command, mainly when running non-interactively.
Signed-off-by: Martin Kletzander <mkletzan@redhat.com>
if (priv->wantReconnect)
vshPrint(ctl, "%s\n", _("Reconnected to the admin server"));
- else
- vshPrint(ctl, "%s\n", _("Connected to the admin server"));
}
return 0;
{
const char *name = NULL;
vshAdmControlPtr priv = ctl->privData;
+ bool connected = priv->conn;
if (vshCommandOptStringReq(ctl, cmd, "name", &name) < 0)
return false;
ctl->connname = vshStrdup(ctl, name);
vshAdmReconnect(ctl);
+ if (!connected)
+ vshPrint(ctl, "%s\n", _("Connected to the admin server"));
return !!priv->conn;
}