print the known cbfs types in cbfstool "usage"
authorStefan Reinauer <stepan@coresystems.de>
Sat, 24 Apr 2010 21:24:06 +0000 (21:24 +0000)
committerStefan Reinauer <stepan@openbios.org>
Sat, 24 Apr 2010 21:24:06 +0000 (21:24 +0000)
Signed-off-by: Stefan Reinauer <stepan@coresystems.de>
Acked-by: Stefan Reinauer <stepan@coresystems.de>
git-svn-id: svn://svn.coreboot.org/coreboot/trunk@5487 2b7e53f0-3cfb-0310-b3e9-8179ed1497e1

util/cbfstool/cbfstool.c
util/cbfstool/common.c
util/cbfstool/common.h

index 183a6144913944c67c3387784c99593e8455a8a7..1d8b7c6b744f8e90abb71b510da214e592b27b65 100644 (file)
@@ -254,17 +254,20 @@ struct command commands[] = {
 void usage(void)
 {
        printf
-           ("cbfstool: Management utility for CBFS formatted ROM images\n"
-            "USAGE:\n" "cbfstool [-h]\n"
-            "cbfstool FILE COMMAND [PARAMETERS]...\n\n" "OPTIONs:\n"
-            " -h               Display this help message\n\n"
+           ("cbfstool: Management utility for CBFS formatted ROM images\n\n"
+            "USAGE:\n" " cbfstool [-h]\n"
+            " cbfstool FILE COMMAND [PARAMETERS]...\n\n" "OPTIONs:\n"
+            "  -h              Display this help message\n\n"
             "COMMANDs:\n"
-            "add FILE NAME TYPE [base address]    Add a component\n"
-            "add-payload FILE NAME [COMP] [base]  Add a payload to the ROM\n"
-            "add-stage FILE NAME [COMP] [base]    Add a stage to the ROM\n"
-            "create SIZE BOOTBLOCK [ALIGN]        Create a ROM file\n"
-            "locate FILE NAME ALIGN               Find a place for a file of that size\n"
-            "print                                Show the contents of the ROM\n");
+            " add FILE NAME TYPE [base address]    Add a component\n"
+            " add-payload FILE NAME [COMP] [base]  Add a payload to the ROM\n"
+            " add-stage FILE NAME [COMP] [base]    Add a stage to the ROM\n"
+            " create SIZE BOOTBLOCK [ALIGN]        Create a ROM file\n"
+            " locate FILE NAME ALIGN               Find a place for a file of that size\n"
+            " print                                Show the contents of the ROM\n\n"
+            "TYPEs:\n"
+            );
+       print_supported_filetypes();
 }
 
 int main(int argc, char **argv)
index e0f4c312a35c86f7d27103b5284fb75f3d3b80a2..30d52816b100f811ce22069376419acff1c2b1a1 100644 (file)
@@ -137,6 +137,17 @@ struct filetypes_t {
        {CBFS_COMPONENT_NULL, "null"}
 };
 
+void print_supported_filetypes(void)
+{
+       int i, number = ARRAY_SIZE(filetypes);
+
+       for (i=0; i<number; i++) {
+               printf(" %s%c", filetypes[i].name, (i==(number-1))?'\n':',');
+               if ((i%8) == 7)
+                       printf("\n");
+       }
+}
+
 const char *strfiletype(uint32_t number)
 {
        int i;
index e149444d380666440c99ef1cd9077a5ccd084fd6..eaf5e71f60d297656bd55b7346bf2eb141bf0588 100644 (file)
@@ -72,4 +72,6 @@ void print_cbfs_directory(const char *filename);
 uint32_t cbfs_find_location(const char *romfile, uint32_t filesize,
                            const char *filename, uint32_t align);
 
+void print_supported_filetypes(void);
+
 #define ARRAY_SIZE(a) (sizeof(a) / sizeof((a)[0]))