VPP-1077 Add meaningful error info, when executing command with enable/disable option
Change-Id: I47dd6f9637f0214971e3191852d84aa92d64b8c0
Signed-off-by: Swarup Nayak <swarupnpvt@gmail.com>
diff --git a/src/vnet/lisp-cp/lisp_cli.c b/src/vnet/lisp-cp/lisp_cli.c
index 07c1c2c..b75f034 100644
--- a/src/vnet/lisp-cp/lisp_cli.c
+++ b/src/vnet/lisp-cp/lisp_cli.c
@@ -902,7 +902,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -955,7 +955,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1008,7 +1008,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
diff --git a/src/vnet/lisp-cp/one_cli.c b/src/vnet/lisp-cp/one_cli.c
index af4a5bd..d812d00 100644
--- a/src/vnet/lisp-cp/one_cli.c
+++ b/src/vnet/lisp-cp/one_cli.c
@@ -1218,7 +1218,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1272,7 +1272,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1325,7 +1325,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1377,7 +1377,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1430,7 +1430,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1497,7 +1497,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -1550,7 +1550,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
@@ -2269,7 +2269,7 @@
/* Get a line of input. */
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{
diff --git a/src/vnet/session/session_cli.c b/src/vnet/session/session_cli.c
index 48c431c..3423026 100755
--- a/src/vnet/session/session_cli.c
+++ b/src/vnet/session/session_cli.c
@@ -484,7 +484,7 @@
clib_error_t *error;
if (!unformat_user (input, unformat_line_input, line_input))
- return 0;
+ return clib_error_return (0, "expected enable | disable");
while (unformat_check_input (line_input) != UNFORMAT_END_OF_INPUT)
{