@@ -265,6 +265,7 @@ static u32 parse_opt_handle(const char *arg)
265
265
int parse_command_line (int argc , char * const argv [])
266
266
{
267
267
int option ;
268
+ unsigned int i ;
268
269
const char * optstring = "d:hqs:t:uH:V" ;
269
270
struct option longopts [] = {
270
271
{ "dev-mem" , required_argument , NULL , 'd' },
@@ -279,6 +280,8 @@ int parse_command_line(int argc, char * const argv[])
279
280
{ "handle" , required_argument , NULL , 'H' },
280
281
{ "oem-string" , required_argument , NULL , 'O' },
281
282
{ "no-sysfs" , no_argument , NULL , 'S' },
283
+ { "list-strings" , no_argument , NULL , 'L' },
284
+ { "list-types" , no_argument , NULL , 'T' },
282
285
{ "version" , no_argument , NULL , 'V' },
283
286
{ NULL , 0 , NULL , 0 }
284
287
};
@@ -332,6 +335,16 @@ int parse_command_line(int argc, char * const argv[])
332
335
case 'S' :
333
336
opt .flags |= FLAG_NO_SYSFS ;
334
337
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 ;
335
348
case 'V' :
336
349
opt .flags |= FLAG_VERSION ;
337
350
break ;
@@ -377,7 +390,9 @@ void print_help(void)
377
390
" -q, --quiet Less verbose output\n"
378
391
" --no-quirks Decode everything without quirks\n"
379
392
" -s, --string KEYWORD Only display the value of the given DMI string\n"
393
+ " --list-strings List available string keywords and exit\n"
380
394
" -t, --type TYPE Only display the entries of given type\n"
395
+ " --list-types List available type keywords and exit\n"
381
396
" -H, --handle HANDLE Only display the entry of given handle\n"
382
397
" -u, --dump Do not decode the entries\n"
383
398
" --dump-bin FILE Dump the DMI data to a binary file\n"
0 commit comments