[dpdk-dev,08/11] pmdinfogen: fix usage message

Message ID 1467905790-10597-9-git-send-email-thomas.monjalon@6wind.com (mailing list archive)
State Superseded, archived
Headers

Commit Message

Thomas Monjalon July 7, 2016, 3:36 p.m. UTC
  The name of the tool is pmdinfogen.

Fixes: 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility")

Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
---
 buildtools/pmdinfogen/pmdinfogen.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)
  

Comments

Neil Horman July 7, 2016, 4:05 p.m. UTC | #1
On Thu, Jul 07, 2016 at 05:36:27PM +0200, Thomas Monjalon wrote:
> The name of the tool is pmdinfogen.
> 
> Fixes: 98b0fdb0ffc6 ("pmdinfogen: add buildtools and pmdinfogen utility")
> 
> Signed-off-by: Thomas Monjalon <thomas.monjalon@6wind.com>
> ---
>  buildtools/pmdinfogen/pmdinfogen.c | 2 +-
>  1 file changed, 1 insertion(+), 1 deletion(-)
> 
> diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
> index beb06f1..1b7b931 100644
> --- a/buildtools/pmdinfogen/pmdinfogen.c
> +++ b/buildtools/pmdinfogen/pmdinfogen.c
> @@ -398,7 +398,7 @@ int main(int argc, char **argv)
>  
>  	if (argc < 3) {
>  		fprintf(stderr,
> -			"usage: pmdinfo <object file> <c output file>\n");
> +			"usage: pmdinfogen <object file> <c output file>\n");
>  		exit(127);
>  	}
>  	parse_elf(&info, argv[1]);
> -- 
> 2.7.0
> 
> 

That should probably be an "%s...", argv[0], just to keep the name in line with
whatever its run as (via the symlink for instance)

Neil
  
Thomas Monjalon July 7, 2016, 4:24 p.m. UTC | #2
2016-07-07 12:05, Neil Horman:
> On Thu, Jul 07, 2016 at 05:36:27PM +0200, Thomas Monjalon wrote:
> > -			"usage: pmdinfo <object file> <c output file>\n");
> > +			"usage: pmdinfogen <object file> <c output file>\n");
> 
> That should probably be an "%s...", argv[0], just to keep the name in line with
> whatever its run as (via the symlink for instance)

Yes I was hesitating.
I think argv[0] gives the full path. So it is often used with basename().
Do you prefer this solution?
  
Neil Horman July 7, 2016, 5:46 p.m. UTC | #3
On Thu, Jul 07, 2016 at 06:24:16PM +0200, Thomas Monjalon wrote:
> 2016-07-07 12:05, Neil Horman:
> > On Thu, Jul 07, 2016 at 05:36:27PM +0200, Thomas Monjalon wrote:
> > > -			"usage: pmdinfo <object file> <c output file>\n");
> > > +			"usage: pmdinfogen <object file> <c output file>\n");
> > 
> > That should probably be an "%s...", argv[0], just to keep the name in line with
> > whatever its run as (via the symlink for instance)
> 
> Yes I was hesitating.
> I think argv[0] gives the full path. So it is often used with basename().
> Do you prefer this solution?

I think that makes more sense yes, given that pmdinfogen might be run as the
direct app or as the dpdk- prefixed symlink

Neil

> 
>
  

Patch

diff --git a/buildtools/pmdinfogen/pmdinfogen.c b/buildtools/pmdinfogen/pmdinfogen.c
index beb06f1..1b7b931 100644
--- a/buildtools/pmdinfogen/pmdinfogen.c
+++ b/buildtools/pmdinfogen/pmdinfogen.c
@@ -398,7 +398,7 @@  int main(int argc, char **argv)
 
 	if (argc < 3) {
 		fprintf(stderr,
-			"usage: pmdinfo <object file> <c output file>\n");
+			"usage: pmdinfogen <object file> <c output file>\n");
 		exit(127);
 	}
 	parse_elf(&info, argv[1]);