summaryrefslogtreecommitdiff
path: root/dmiopt.c
diff options
context:
space:
mode:
authorJean Delvare <jdelvare@suse.de>2008-02-16 18:12:35 +0000
committerJean Delvare <jdelvare@suse.de>2008-02-16 18:12:35 +0000
commit4e721204a471e64c041a4c260707d0d52d1811e6 (patch)
treebbc22a0b6ef4dd7315490a785cdaf0d1f5fc4c29 /dmiopt.c
parent8c6bf0cea2a592591449c78e09570aa570987cc6 (diff)
downloaddmidecode-git-4e721204a471e64c041a4c260707d0d52d1811e6.tar.gz
New option --dump-bin, dump the DMI data to a sparse binary file.
Diffstat (limited to 'dmiopt.c')
-rw-r--r--dmiopt.c11
1 files changed, 11 insertions, 0 deletions
diff --git a/dmiopt.c b/dmiopt.c
index d571108..50ff0a3 100644
--- a/dmiopt.c
+++ b/dmiopt.c
@@ -223,6 +223,7 @@ int parse_command_line(int argc, char * const argv[])
{ "string", required_argument, NULL, 's' },
{ "type", required_argument, NULL, 't' },
{ "dump", no_argument, NULL, 'u' },
+ { "dump-bin", required_argument, NULL, 'B' },
{ "version", no_argument, NULL, 'V' },
{ 0, 0, 0, 0 }
};
@@ -230,6 +231,10 @@ int parse_command_line(int argc, char * const argv[])
while((option=getopt_long(argc, argv, optstring, longopts, NULL))!=-1)
switch(option)
{
+ case 'B':
+ opt.flags|=FLAG_DUMP_BIN;
+ opt.dumpfile=optarg;
+ break;
case 'd':
opt.devmem=optarg;
break;
@@ -287,6 +292,11 @@ int parse_command_line(int argc, char * const argv[])
fprintf(stderr, "Options --quiet and --dump are mutually exclusive\n");
return -1;
}
+ if((opt.flags & FLAG_DUMP_BIN) && (opt.type!=NULL || opt.string!=NULL))
+ {
+ fprintf(stderr, "Options --dump-bin, --string and --type are mutually exclusive\n");
+ return -1;
+ }
return 0;
}
@@ -302,6 +312,7 @@ void print_help(void)
" -s, --string KEYWORD Only display the value of the given DMI string\n"
" -t, --type TYPE Only display the entries of given type\n"
" -u, --dump Do not decode the entries\n"
+ " --dump-bin FILE Dump the DMI data to a sparse binary file\n"
" -V, --version Display the version and exit\n";
printf("%s", help);