Skip to content

Commit 322cec2

Browse files
committed
Options --dump and --string are mutually exclusive.
1 parent fd8d7a8 commit 322cec2

File tree

2 files changed

+9
-2
lines changed

2 files changed

+9
-2
lines changed

dmiopt.c

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -276,7 +276,13 @@ int parse_command_line(int argc, char * const argv[])
276276

277277
if(opt.type!=NULL && opt.string_offset)
278278
{
279-
fprintf(stderr, "String and type modes are mutually exclusive\n");
279+
fprintf(stderr, "Options --string and --type are mutually exclusive\n");
280+
return -1;
281+
}
282+
283+
if((opt.flags & FLAG_DUMP) && opt.string_offset)
284+
{
285+
fprintf(stderr, "Options --string and --dump are mutually exclusive\n");
280286
return -1;
281287
}
282288

man/dmidecode.8

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -87,7 +87,7 @@ keywords is printed and
8787
.B dmidecode
8888
exits with an error.
8989
This option cannot be used more than once, and implies \fB--quiet\fR.
90-
Mutually exclusive with \fB--type\fR.
90+
Mutually exclusive with \fB--type\fR and \fB--dump\fR.
9191
.TP
9292
.BR "-t" ", " "--type TYPE"
9393
Only display the entries of type \fBTYPE\fR. \fBTYPE\fR can be either a
@@ -109,6 +109,7 @@ Do not decode the entries, dump their contents as hexadecimal instead.
109109
Note that this is still a text output, no binary data will be thrown upon
110110
you. The strings attached to each entry are displayed as both
111111
hexadecimal and \s-1ASCII\s0. This option is mainly useful for debugging.
112+
Mutually exclusive with \fB--string\fR.
112113
.TP
113114
.BR "-h" ", " "--help"
114115
Display usage information and exit

0 commit comments

Comments
 (0)