summaryrefslogtreecommitdiff
path: root/dmiopt.c
diff options
context:
space:
mode:
authorJörg Frings-Fürst <debian@jff.email>2024-06-30 20:02:05 +0200
committerJörg Frings-Fürst <debian@jff.email>2024-06-30 20:02:05 +0200
commitc9aac994d65f7bcc3659e3219d6729a24c803fcf (patch)
tree392bee74d0652cac2c3677da3268bedc14791293 /dmiopt.c
parent67edb6d3e91421bc50fd51baa1f4ce214efb98c7 (diff)
New upstream version 3.6upstream/3.6upstream
Diffstat (limited to 'dmiopt.c')
-rw-r--r--dmiopt.c17
1 files changed, 16 insertions, 1 deletions
diff --git a/dmiopt.c b/dmiopt.c
index fa84f22..0db14e0 100644
--- a/dmiopt.c
+++ b/dmiopt.c
@@ -2,7 +2,7 @@
* Command line handling of dmidecode
* This file is part of the dmidecode project.
*
- * Copyright (C) 2005-2008 Jean Delvare <jdelvare@suse.de>
+ * Copyright (C) 2005-2023 Jean Delvare <jdelvare@suse.de>
*
* This program is free software; you can redistribute it and/or modify
* it under the terms of the GNU General Public License as published by
@@ -265,6 +265,7 @@ static u32 parse_opt_handle(const char *arg)
int parse_command_line(int argc, char * const argv[])
{
int option;
+ unsigned int i;
const char *optstring = "d:hqs:t:uH:V";
struct option longopts[] = {
{ "dev-mem", required_argument, NULL, 'd' },
@@ -279,6 +280,8 @@ int parse_command_line(int argc, char * const argv[])
{ "handle", required_argument, NULL, 'H' },
{ "oem-string", required_argument, NULL, 'O' },
{ "no-sysfs", no_argument, NULL, 'S' },
+ { "list-strings", no_argument, NULL, 'L' },
+ { "list-types", no_argument, NULL, 'T' },
{ "version", no_argument, NULL, 'V' },
{ NULL, 0, NULL, 0 }
};
@@ -332,6 +335,16 @@ int parse_command_line(int argc, char * const argv[])
case 'S':
opt.flags |= FLAG_NO_SYSFS;
break;
+ case 'L':
+ for (i = 0; i < ARRAY_SIZE(opt_string_keyword); i++)
+ fprintf(stdout, "%s\n", opt_string_keyword[i].keyword);
+ opt.flags |= FLAG_LIST;
+ return 0;
+ case 'T':
+ for (i = 0; i < ARRAY_SIZE(opt_type_keyword); i++)
+ fprintf(stdout, "%s\n", opt_type_keyword[i].keyword);
+ opt.flags |= FLAG_LIST;
+ return 0;
case 'V':
opt.flags |= FLAG_VERSION;
break;
@@ -377,7 +390,9 @@ void print_help(void)
" -q, --quiet Less verbose output\n"
" --no-quirks Decode everything without quirks\n"
" -s, --string KEYWORD Only display the value of the given DMI string\n"
+ " --list-strings List available string keywords and exit\n"
" -t, --type TYPE Only display the entries of given type\n"
+ " --list-types List available type keywords and exit\n"
" -H, --handle HANDLE Only display the entry of given handle\n"
" -u, --dump Do not decode the entries\n"
" --dump-bin FILE Dump the DMI data to a binary file\n"