@@ -265,6 +265,7 @@ static u32 parse_opt_handle(const char *arg)
265265int parse_command_line (int argc , char * const argv [])
266266{
267267 int option ;
268+ unsigned int i ;
268269 const char * optstring = "d:hqs:t:uH:V" ;
269270 struct option longopts [] = {
270271 { "dev-mem" , required_argument , NULL , 'd' },
@@ -279,6 +280,8 @@ int parse_command_line(int argc, char * const argv[])
279280 { "handle" , required_argument , NULL , 'H' },
280281 { "oem-string" , required_argument , NULL , 'O' },
281282 { "no-sysfs" , no_argument , NULL , 'S' },
283+ { "list-strings" , no_argument , NULL , 'L' },
284+ { "list-types" , no_argument , NULL , 'T' },
282285 { "version" , no_argument , NULL , 'V' },
283286 { NULL , 0 , NULL , 0 }
284287 };
@@ -332,6 +335,16 @@ int parse_command_line(int argc, char * const argv[])
332335 case 'S' :
333336 opt .flags |= FLAG_NO_SYSFS ;
334337 break ;
338+ case 'L' :
339+ for (i = 0 ; i < ARRAY_SIZE (opt_string_keyword ); i ++ )
340+ fprintf (stdout , "%s\n" , opt_string_keyword [i ].keyword );
341+ opt .flags |= FLAG_LIST ;
342+ return 0 ;
343+ case 'T' :
344+ for (i = 0 ; i < ARRAY_SIZE (opt_type_keyword ); i ++ )
345+ fprintf (stdout , "%s\n" , opt_type_keyword [i ].keyword );
346+ opt .flags |= FLAG_LIST ;
347+ return 0 ;
335348 case 'V' :
336349 opt .flags |= FLAG_VERSION ;
337350 break ;
@@ -377,7 +390,9 @@ void print_help(void)
377390 " -q, --quiet Less verbose output\n"
378391 " --no-quirks Decode everything without quirks\n"
379392 " -s, --string KEYWORD Only display the value of the given DMI string\n"
393+ " --list-strings List available string keywords and exit\n"
380394 " -t, --type TYPE Only display the entries of given type\n"
395+ " --list-types List available type keywords and exit\n"
381396 " -H, --handle HANDLE Only display the entry of given handle\n"
382397 " -u, --dump Do not decode the entries\n"
383398 " --dump-bin FILE Dump the DMI data to a binary file\n"
0 commit comments