examples: modify error message for ip pipeline

Message ID 1560521132-12232-1-git-send-email-agalyax.babu.radhakrishnan@intel.com (mailing list archive)
State Rejected, archived
Delegated to: Cristian Dumitrescu
Headers
Series examples: modify error message for ip pipeline |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK
ci/intel-Performance-Testing success Performance Testing PASS
ci/mellanox-Performance-Testing fail Performance Testing issues

Commit Message

Babu Radhakrishnan, AgalyaX June 14, 2019, 2:05 p.m. UTC
  From: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>

Added help command in error message for ip pipeline commands.

Signed-off-by: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
---
 examples/ip_pipeline/cli.c | 12 ++++++------
 1 file changed, 6 insertions(+), 6 deletions(-)
  

Comments

Cristian Dumitrescu July 9, 2019, 9:31 a.m. UTC | #1
> -----Original Message-----
> From: Babu Radhakrishnan, AgalyaX
> Sent: Friday, June 14, 2019 3:06 PM
> To: dev@dpdk.org
> Cc: Pattan, Reshma <reshma.pattan@intel.com>; Dumitrescu, Cristian
> <cristian.dumitrescu@intel.com>; Babu Radhakrishnan, AgalyaX
> <agalyax.babu.radhakrishnan@intel.com>
> Subject: [PATCH] examples: modify error message for ip pipeline
> 
> From: Agalya Babu RadhaKrishnan <agalyax.babu.radhakrishnan@intel.com>
> 
> Added help command in error message for ip pipeline commands.
> 
> Signed-off-by: Agalya Babu RadhaKrishnan
> <agalyax.babu.radhakrishnan@intel.com>
> ---
>  examples/ip_pipeline/cli.c | 12 ++++++------
>  1 file changed, 6 insertions(+), 6 deletions(-)
> 
> diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
> index 309b2936e..8a651bbbc 100644
> --- a/examples/ip_pipeline/cli.c
> +++ b/examples/ip_pipeline/cli.c
> @@ -30,12 +30,12 @@
> 
>  #define MSG_OUT_OF_MEMORY   "Not enough memory.\n"
>  #define MSG_CMD_UNKNOWN     "Unknown command \"%s\".\n"
> -#define MSG_CMD_UNIMPLEM    "Command \"%s\" not implemented.\n"
> -#define MSG_ARG_NOT_ENOUGH  "Not enough arguments for command
> \"%s\".\n"
> -#define MSG_ARG_TOO_MANY    "Too many arguments for command
> \"%s\".\n"
> -#define MSG_ARG_MISMATCH    "Wrong number of arguments for
> command \"%s\".\n"
> -#define MSG_ARG_NOT_FOUND   "Argument \"%s\" not found.\n"
> -#define MSG_ARG_INVALID     "Invalid value for argument \"%s\".\n"
> +#define MSG_CMD_UNIMPLEM    "Command \"%s\" not implemented. Try
> help <cmd>\n"
> +#define MSG_ARG_NOT_ENOUGH  "Not enough arguments for command
> \"%s\". Try help <cmd>\n"
> +#define MSG_ARG_TOO_MANY    "Too many arguments for command
> \"%s\". Try help <cmd>\n"
> +#define MSG_ARG_MISMATCH    "Wrong number of arguments for
> command \"%s\". Try help <cmd>\n"
> +#define MSG_ARG_NOT_FOUND   "Argument \"%s\" not found. Try help
> <cmd>\n"
> +#define MSG_ARG_INVALID     "Invalid value for argument \"%s\". Try help
> <cmd>\n"
>  #define MSG_FILE_ERR        "Error in file \"%s\" at line %u.\n"
>  #define MSG_FILE_NOT_ENOUGH "Not enough rules in file \"%s\".\n"
>  #define MSG_CMD_FAIL        "Command \"%s\" failed.\n"
> --
> 2.14.1

NAK

I don't see the value to add "try help command" on all the error messages, the user is already aware that there is a help command available, and some people might actually find this repetition annoying.
  
Babu Radhakrishnan, AgalyaX July 26, 2019, 1:41 p.m. UTC | #2
Hi,

> -----Original Message-----
> From: Dumitrescu, Cristian
> Sent: Tuesday, July 9, 2019 3:01 PM
> To: Babu Radhakrishnan, AgalyaX <agalyax.babu.radhakrishnan@intel.com>;
> dev@dpdk.org
> Cc: Pattan, Reshma <reshma.pattan@intel.com>
> Subject: RE: [PATCH] examples: modify error message for ip pipeline
> 
> 
> 
> > -----Original Message-----
> > From: Babu Radhakrishnan, AgalyaX
> > Sent: Friday, June 14, 2019 3:06 PM
> > To: dev@dpdk.org
> > Cc: Pattan, Reshma <reshma.pattan@intel.com>; Dumitrescu, Cristian
> > <cristian.dumitrescu@intel.com>; Babu Radhakrishnan, AgalyaX
> > <agalyax.babu.radhakrishnan@intel.com>
> > Subject: [PATCH] examples: modify error message for ip pipeline
> >
> > From: Agalya Babu RadhaKrishnan
> <agalyax.babu.radhakrishnan@intel.com>
> >
> > Added help command in error message for ip pipeline commands.
> >
> > Signed-off-by: Agalya Babu RadhaKrishnan
> > <agalyax.babu.radhakrishnan@intel.com>
> > ---
> >  examples/ip_pipeline/cli.c | 12 ++++++------
> >  1 file changed, 6 insertions(+), 6 deletions(-)
> >
> > diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
> > index 309b2936e..8a651bbbc 100644
> > --- a/examples/ip_pipeline/cli.c
> > +++ b/examples/ip_pipeline/cli.c
> > @@ -30,12 +30,12 @@
> >
> >  #define MSG_OUT_OF_MEMORY   "Not enough memory.\n"
> >  #define MSG_CMD_UNKNOWN     "Unknown command \"%s\".\n"
> > -#define MSG_CMD_UNIMPLEM    "Command \"%s\" not
> implemented.\n"
> > -#define MSG_ARG_NOT_ENOUGH  "Not enough arguments for command
> > \"%s\".\n"
> > -#define MSG_ARG_TOO_MANY    "Too many arguments for command
> > \"%s\".\n"
> > -#define MSG_ARG_MISMATCH    "Wrong number of arguments for
> > command \"%s\".\n"
> > -#define MSG_ARG_NOT_FOUND   "Argument \"%s\" not found.\n"
> > -#define MSG_ARG_INVALID     "Invalid value for argument \"%s\".\n"
> > +#define MSG_CMD_UNIMPLEM    "Command \"%s\" not implemented.
> Try
> > help <cmd>\n"
> > +#define MSG_ARG_NOT_ENOUGH  "Not enough arguments for
> command
> > \"%s\". Try help <cmd>\n"
> > +#define MSG_ARG_TOO_MANY    "Too many arguments for command
> > \"%s\". Try help <cmd>\n"
> > +#define MSG_ARG_MISMATCH    "Wrong number of arguments for
> > command \"%s\". Try help <cmd>\n"
> > +#define MSG_ARG_NOT_FOUND   "Argument \"%s\" not found. Try help
> > <cmd>\n"
> > +#define MSG_ARG_INVALID     "Invalid value for argument \"%s\". Try
> help
> > <cmd>\n"
> >  #define MSG_FILE_ERR        "Error in file \"%s\" at line %u.\n"
> >  #define MSG_FILE_NOT_ENOUGH "Not enough rules in file \"%s\".\n"
> >  #define MSG_CMD_FAIL        "Command \"%s\" failed.\n"
> > --
> > 2.14.1
> 
> NAK
> 
> I don't see the value to add "try help command" on all the error messages,
> the user is already aware that there is a help command available, and some
> people might actually find this repetition annoying.

Okay,  we would like to share our observations and views also on this.

As the info on help command is not available in doc/nor in command line, user might have to explore its right usage for ip_pipeline.

Following are the possible way of help command:
 --help, - help, help followed by command

So ,Providing correct syntax for searching the command details in console would be more clear from user perspective.
Hence "try help command" is provided whenever a command fails.

Kindly let us know if you still feel it is not appropriate.

Regards,
Agalya B
  

Patch

diff --git a/examples/ip_pipeline/cli.c b/examples/ip_pipeline/cli.c
index 309b2936e..8a651bbbc 100644
--- a/examples/ip_pipeline/cli.c
+++ b/examples/ip_pipeline/cli.c
@@ -30,12 +30,12 @@ 
 
 #define MSG_OUT_OF_MEMORY   "Not enough memory.\n"
 #define MSG_CMD_UNKNOWN     "Unknown command \"%s\".\n"
-#define MSG_CMD_UNIMPLEM    "Command \"%s\" not implemented.\n"
-#define MSG_ARG_NOT_ENOUGH  "Not enough arguments for command \"%s\".\n"
-#define MSG_ARG_TOO_MANY    "Too many arguments for command \"%s\".\n"
-#define MSG_ARG_MISMATCH    "Wrong number of arguments for command \"%s\".\n"
-#define MSG_ARG_NOT_FOUND   "Argument \"%s\" not found.\n"
-#define MSG_ARG_INVALID     "Invalid value for argument \"%s\".\n"
+#define MSG_CMD_UNIMPLEM    "Command \"%s\" not implemented. Try help <cmd>\n"
+#define MSG_ARG_NOT_ENOUGH  "Not enough arguments for command \"%s\". Try help <cmd>\n"
+#define MSG_ARG_TOO_MANY    "Too many arguments for command \"%s\". Try help <cmd>\n"
+#define MSG_ARG_MISMATCH    "Wrong number of arguments for command \"%s\". Try help <cmd>\n"
+#define MSG_ARG_NOT_FOUND   "Argument \"%s\" not found. Try help <cmd>\n"
+#define MSG_ARG_INVALID     "Invalid value for argument \"%s\". Try help <cmd>\n"
 #define MSG_FILE_ERR        "Error in file \"%s\" at line %u.\n"
 #define MSG_FILE_NOT_ENOUGH "Not enough rules in file \"%s\".\n"
 #define MSG_CMD_FAIL        "Command \"%s\" failed.\n"