From e43a05c0cbb1add37ff757567a8f42a26270707f Mon Sep 17 00:00:00 2001 From: Tony Kuker Date: Sat, 4 Feb 2023 22:58:25 -0600 Subject: [PATCH] Fix logic for needing file name #1092 --- cpp/scsidump/scsidump_core.cpp | 8 ++++++-- 1 file changed, 6 insertions(+), 2 deletions(-) diff --git a/cpp/scsidump/scsidump_core.cpp b/cpp/scsidump/scsidump_core.cpp index 2fd0d157..7ebbfafd 100644 --- a/cpp/scsidump/scsidump_core.cpp +++ b/cpp/scsidump/scsidump_core.cpp @@ -68,7 +68,7 @@ bool ScsiDump::Banner(const vector& args) const << " -v Enable verbose logging. (deprecated - use -L instead)\n" << " -r Restore instead of dump.\n" << " -p Generate .properties file to be used with the PiSCSI web interface. Only valid for dump mode.\n" - << " -q Executes Inquiry of the specified target device, then exits.\n" + << " -q Executes INQUIRY of the specified target device, then exits.\n" << flush; return false; @@ -156,7 +156,11 @@ void ScsiDump::ParseArguments(const vector& args) throw parser_exception("Target ID and PiSCSI board ID must not be identical"); } - if (!inquiry_only && filename.empty()) { + // inq only & !prop = no file + // inq only & prop = need file + // !inq only & !prop = need file + // !inq only & prop = need file + if ((properties_file || !inquiry_only) && filename.empty()) { throw parser_exception("Missing filename"); }