summaryrefslogtreecommitdiff
path: root/dmiopt.c
diff options
context:
space:
mode:
authorkhali <khali>2008-10-25 21:02:08 +0000
committerkhali <khali>2008-10-25 21:02:08 +0000
commitbb33c1379c24006d9d6966920af886079c86707e (patch)
tree998dc24e07d173b405187a8de9b40c82e0ccf373 /dmiopt.c
parentbaf60faa54f9d2ca0cdb436b0a7bc7608bf1fadc (diff)
downloaddmidecode-bb33c1379c24006d9d6966920af886079c86707e.tar.gz
New option --from-dump, read the DMI data from a 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 b76b8fc..5d5cad1 100644
--- a/dmiopt.c
+++ b/dmiopt.c
@@ -224,6 +224,7 @@ int parse_command_line(int argc, char * const argv[])
{ "type", required_argument, NULL, 't' },
{ "dump", no_argument, NULL, 'u' },
{ "dump-bin", required_argument, NULL, 'B' },
+ { "from-dump", required_argument, NULL, 'F' },
{ "version", no_argument, NULL, 'V' },
{ 0, 0, 0, 0 }
};
@@ -235,6 +236,10 @@ int parse_command_line(int argc, char * const argv[])
opt.flags|=FLAG_DUMP_BIN;
opt.dumpfile=optarg;
break;
+ case 'F':
+ opt.flags|=FLAG_FROM_DUMP;
+ opt.dumpfile=optarg;
+ break;
case 'd':
opt.devmem=optarg;
break;
@@ -297,6 +302,11 @@ int parse_command_line(int argc, char * const argv[])
fprintf(stderr, "Options --dump-bin, --string and --type are mutually exclusive\n");
return -1;
}
+ if((opt.flags & FLAG_FROM_DUMP) && (opt.flags & FLAG_DUMP_BIN))
+ {
+ fprintf(stderr, "Options --from-dump and --dump-bin are mutually exclusive\n");
+ return -1;
+ }
return 0;
}
@@ -313,6 +323,7 @@ void print_help(void)
" -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 binary file\n"
+ " --from-dump FILE Read the DMI data from a binary file\n"
" -V, --version Display the version and exit\n";
printf("%s", help);