summaryrefslogtreecommitdiffstats
path: root/src/vlib/unix
diff options
context:
space:
mode:
Diffstat (limited to 'src/vlib/unix')
-rw-r--r--src/vlib/unix/cli.c4
-rw-r--r--src/vlib/unix/main.c10
-rw-r--r--src/vlib/unix/unix.h2
3 files changed, 14 insertions, 2 deletions
diff --git a/src/vlib/unix/cli.c b/src/vlib/unix/cli.c
index 2f34c8deae2..c7732ae431f 100644
--- a/src/vlib/unix/cli.c
+++ b/src/vlib/unix/cli.c
@@ -1263,9 +1263,9 @@ unix_cli_file_welcome (unix_cli_main_t * cm, unix_cli_file_t * cf)
*/
unix_cli_add_pending_output (uf, cf, (u8 *) "\r", 1);
- if (!um->cli_no_banner)
+ if (!um->cli_no_banner && (um->flags & UNIX_FLAG_NOBANNER) == 0)
{
- if (cf->ansi_capable)
+ if (cf->ansi_capable && (um->flags & UNIX_FLAG_NOCOLOR) == 0)
{
banner = unix_cli_banner_color;
len = ARRAY_LEN (unix_cli_banner_color);
diff --git a/src/vlib/unix/main.c b/src/vlib/unix/main.c
index 83a3a1f643b..2f1b6ecdae0 100644
--- a/src/vlib/unix/main.c
+++ b/src/vlib/unix/main.c
@@ -402,6 +402,10 @@ unix_config (vlib_main_t * vm, unformat_input_t * input)
um->flags |= UNIX_FLAG_NODAEMON;
else if (unformat (input, "nosyslog"))
um->flags |= UNIX_FLAG_NOSYSLOG;
+ else if (unformat (input, "nocolor"))
+ um->flags |= UNIX_FLAG_NOCOLOR;
+ else if (unformat (input, "nobanner"))
+ um->flags |= UNIX_FLAG_NOBANNER;
else if (unformat (input, "cli-prompt %s", &cli_prompt))
vlib_unix_cli_set_prompt (cli_prompt);
else
@@ -576,6 +580,12 @@ unix_config (vlib_main_t * vm, unformat_input_t * input)
* when invoking VPP applications from a process monitor which
* pipe stdout/stderr to a dedicated logger service.
*
+ * @cfgcmd{nocolor}
+ * Do not use colors in outputs.
+ * *
+ * @cfgcmd{nobanner}
+ * Do not display startup banner.
+ *
* @cfgcmd{exec, <filename>}
* @par <code>startup-config &lt;filename&gt;</code>
* Read startup operational configuration from @c filename.
diff --git a/src/vlib/unix/unix.h b/src/vlib/unix/unix.h
index 9fa95a0c1d6..44dcf712e8d 100644
--- a/src/vlib/unix/unix.h
+++ b/src/vlib/unix/unix.h
@@ -60,6 +60,8 @@ typedef struct
#define UNIX_FLAG_INTERACTIVE (1 << 0)
#define UNIX_FLAG_NODAEMON (1 << 1)
#define UNIX_FLAG_NOSYSLOG (1 << 2)
+#define UNIX_FLAG_NOCOLOR (1 << 3)
+#define UNIX_FLAG_NOBANNER (1 << 4)
/* CLI listen socket. */