aboutsummaryrefslogtreecommitdiffstats
path: root/vpp-api-test/scripts/vppctl
diff options
context:
space:
mode:
authorPadraig Connolly <padraig.connolly@intel.com>2016-11-14 11:37:37 +0000
committerChris Luke <chris_luke@comcast.com>2016-11-22 16:22:21 +0000
commitfba8a9510283a1b7d8e047fe93a47612c4c1b7cd (patch)
tree38dfd298b5c426a843a61915ea588116066b6346 /vpp-api-test/scripts/vppctl
parentc0e939b34cef55fe8a99e1d26eb9010b735559c8 (diff)
add vpp banner graphic when vpp-cli starts
Added check if termianl output is tty *If terminal is tty, display banner Added "FD.io VPP" banner to vppctl script on startup *FD.io displays in red *VPP displays in white Change-Id: Iaab3513d4f9d7ba5eefe070c1daf319f5014cf85 Signed-off-by: Padraig Connolly <padraig.connolly@intel.com>
Diffstat (limited to 'vpp-api-test/scripts/vppctl')
-rw-r--r--[-rwxr-xr-x]vpp-api-test/scripts/vppctl17
1 files changed, 14 insertions, 3 deletions
diff --git a/vpp-api-test/scripts/vppctl b/vpp-api-test/scripts/vppctl
index 6dfa3b9b8a5..872590ccfe7 100755..100644
--- a/vpp-api-test/scripts/vppctl
+++ b/vpp-api-test/scripts/vppctl
@@ -1,4 +1,4 @@
-#!/usr/bin/python
+#! /usr/bin/python
'''
Copyright 2016 Intel Corporation
@@ -88,13 +88,24 @@ class Vppctl(Cmd):
if __name__ == '__main__':
command_args = sys.argv
+
if not len(command_args) > 1:
prompt = Vppctl()
- prompt.prompt = 'vpp# '
- prompt.cmdloop("Starting Vppctl...")
+ red_set = '\033[31m'
+ norm_set = '\033[0m'
+ if sys.stdout.isatty():
+ prompt.prompt = 'vpp# '
+ prompt.cmdloop(red_set + " _______ _ " + norm_set + " _ _____ ___ \n" +
+ red_set + " __/ __/ _ \ (_)__ " + norm_set + " | | / / _ \/ _ \\\n" +
+ red_set + " _/ _// // / / / _ \\" + norm_set + " | |/ / ___/ ___/\n" +
+ red_set + " /_/ /____(_)_/\___/ " + norm_set + "|___/_/ /_/ \n")
+ else:
+ prompt.cmdloop()
else:
del command_args[0]
stdout_value = " ".join(command_args)
VatAddress = Vppctl()
VatAddress.runVat(stdout_value)
+
+