[Intel-gfx] [PATCH i-g-t 00/17] tools/intel_bios_reader updates

Marius Vlad marius.c.vlad at intel.com
Wed May 4 17:35:18 UTC 2016


Care to add this usage for it as well?

Signed-off-by: Marius Vlad <marius.c.vlad at intel.com>
---
 tools/intel_bios_reader.c | 19 ++++++++++++++++++-
 1 file changed, 18 insertions(+), 1 deletion(-)

diff --git a/tools/intel_bios_reader.c b/tools/intel_bios_reader.c
index de90f5d..4192919 100644
--- a/tools/intel_bios_reader.c
+++ b/tools/intel_bios_reader.c
@@ -1414,8 +1414,22 @@ enum opt {
 	OPT_ALL_PANELS,
 	OPT_HEXDUMP,
 	OPT_BLOCK,
+	OPT_USAGE
 };
 
+static void usage(const char *toolname)
+{
+	fprintf(stderr, "usage %s:", toolname);
+	fprintf(stderr, " --file=<rom file>"
+			" [--devid=<device_id>]"
+			" [--panel-type=<panel_type>]"
+			" [--all-panels]"
+			" [--hexdump]"
+			" [--block=<block_no>]"
+			" [--help]\n");
+
+}
+
 int main(int argc, char **argv)
 {
 	uint8_t *VBIOS;
@@ -1443,6 +1457,7 @@ int main(int argc, char **argv)
 		{ "all-panels",	no_argument,		NULL,	OPT_ALL_PANELS },
 		{ "hexdump",	no_argument,		NULL,	OPT_HEXDUMP },
 		{ "block",	required_argument,	NULL,	OPT_BLOCK },
+		{ "help",	no_argument,		NULL,	OPT_USAGE },
 		{ 0 }
 	};
 
@@ -1484,7 +1499,9 @@ int main(int argc, char **argv)
 			break;
 		case OPT_END:
 			break;
+		case OPT_USAGE: /* fall-through */
 		case OPT_UNKNOWN:
+			usage(toolname);
 			return EXIT_FAILURE;
 		}
 	}
@@ -1497,7 +1514,7 @@ int main(int argc, char **argv)
 			/* for backwards compatibility */
 			filename = argv[0];
 		} else {
-			printf("usage: %s --file=<rom file>\n", toolname);
+			usage(toolname);
 			return EXIT_FAILURE;
 		}
 	}
-- 
2.5.0


On Tue, May 03, 2016 at 05:18:50PM +0300, Jani Nikula wrote:
> Give the intel_bios_reader tool some love. The last patch updating the
> man page doubles as a summary.
> 
> BR,
> Jani.
> 
> 
> Jani Nikula (17):
>   tools/intel_bios_reader: drop unused macros
>   tools/intel_bios_reader: make VBIOS non-global
>   tools/intel_bios_reader: add command line option parsing and --file
>     parameter
>   tools/intel_bios_reader: add --devid parameter
>   tools/intel_bios_reader: drop unused lvds_support variable
>   tools/intel_bios_reader: drop silly tv_present variable and printout
>   tools/intel_bios_reader: pass around a context pointer instead of
>     bdb_header
>   tools/intel_bios_reader: move more globals to struct context
>   tools/intel_bios_reader: move devid to context too
>   tools/intel_bios_reader: drop dependencies on lvds block parsing
>   tools/intel_bios_reader: let the user specify panel type on the
>     command line
>   tools/intel_bios_reader: dump the blocks in numerical order
>   tools/intel_bios_reader: add --hexdump option to dump hex, disable by
>     default
>   tools/intel_bios_reader: add support for dumping only specific section
>   tools/intel_bios_reader: add --all-panels option to dump all panels
>   tools/intel_bios_reader: free the block returned by find_section
>   man: update intel_bios_reader man page
> 
>  man/intel_bios_reader.rst |  48 +++++--
>  tools/intel_bios_reader.c | 310 +++++++++++++++++++++++++++++++---------------
>  2 files changed, 249 insertions(+), 109 deletions(-)
> 
> -- 
> 2.1.4
> 
> _______________________________________________
> Intel-gfx mailing list
> Intel-gfx at lists.freedesktop.org
> https://lists.freedesktop.org/mailman/listinfo/intel-gfx
-------------- next part --------------
A non-text attachment was scrubbed...
Name: signature.asc
Type: application/pgp-signature
Size: 473 bytes
Desc: Digital signature
URL: <https://lists.freedesktop.org/archives/intel-gfx/attachments/20160504/c88a4896/attachment.sig>


More information about the Intel-gfx mailing list