Patchwork Make the 'flashrom --help' output look a bit nicer

login
register
about
Submitter Uwe Hermann
Date 2010-05-20 19:11:39
Message ID <20100520191139.GC15971@greenwood>
Download mbox | patch
Permalink /patch/1363/
State Accepted
Commit r1030
Headers show

Comments

Uwe Hermann - 2010-05-20 19:11:39
See patch.


Uwe.
Carl-Daniel Hailfinger - 2010-06-03 15:23:57
On 20.05.2010 21:11, Uwe Hermann wrote:
> Make the 'flashrom --help' output look a bit nicer.
>
> Only print "flashrom" as the program name unconditionally, not the full path
> and program name (e.g. "/home/foo/bar/baz/flashrom" or on Windows
> "C:\Foo\Bar\Whatever\flashrom.exe"). The path or exact executable name is
> not really useful to print here, if you managed to run --help you already
> know it, and it just makes the output look ugly.
>
> Also, add a missing newline to make the output look nicer.
>
> Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>
>   

Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Regards,
Carl-Daniel
Uwe Hermann - 2010-06-04 17:10:53
On Thu, Jun 03, 2010 at 05:23:57PM +0200, Carl-Daniel Hailfinger wrote:
> Acked-by: Carl-Daniel Hailfinger <c-d.hailfinger.devel.2006@gmx.net>

Thanks, r1030 with one additional place where argv[0] was used being
eliminated. I also reverted the wiki printing error I accidentally
introduced in r1029.


Uwe.

Patch

Make the 'flashrom --help' output look a bit nicer.

Only print "flashrom" as the program name unconditionally, not the full path
and program name (e.g. "/home/foo/bar/baz/flashrom" or on Windows
"C:\Foo\Bar\Whatever\flashrom.exe"). The path or exact executable name is
not really useful to print here, if you managed to run --help you already
know it, and it just makes the output look ugly.

Also, add a missing newline to make the output look nicer.

Signed-off-by: Uwe Hermann <uwe@hermann-uwe.de>

Index: cli_classic.c
===================================================================
--- cli_classic.c	(Revision 1001)
+++ cli_classic.c	(Arbeitskopie)
@@ -37,14 +37,13 @@ 
 	int remaining = 0;
 	enum programmer p;
 
-	printf("Usage: %s [-n] [-V] [-f] [-h|-R|-L|"
+	printf("Usage: flashrom [-n] [-V] [-f] [-h|-R|-L|"
 #if PRINT_WIKI_SUPPORT == 1
 	         "-z|"
 #endif
 	         "-E|-r <file>|-w <file>|-v <file>]\n"
 	       "       [-c <chipname>] [-m [<vendor>:]<part>] [-l <file>]\n"
-	       "       [-i <image>] [-p <programmername>[:<parameters>]]\n",
-	       name);
+	       "       [-i <image>] [-p <programmername>[:<parameters>]]\n\n");
 
 	printf("Please note that the command line interface for flashrom has "
 	         "changed between\n"