diff --git a/cpp/s2pexec/s2pexec_core.cpp b/cpp/s2pexec/s2pexec_core.cpp index 7192d2c4..207e3d68 100644 --- a/cpp/s2pexec/s2pexec_core.cpp +++ b/cpp/s2pexec/s2pexec_core.cpp @@ -59,7 +59,7 @@ void S2pExec::Banner(bool header, bool usage) << " --binary-output-file/-F FILE Binary output file for data received.\n" << " --hex-output-file/-T FILE Hexadecimal text output file for data received.\n" << " --timeout/-o TIMEOUT The command timeout in seconds, default is 3 s.\n" - << " --no-request-sense/-n Do not run REQUEST SENSE on error.\n" + << " --request-sense/-R Automatically send REQUEST SENSE on error.\n" << " --reset-bus/-r Reset the bus.\n" << " --hex-only/-x Do not display/save the offset and ASCII data.\n" << " --version/-v Display the program version.\n" @@ -101,7 +101,7 @@ bool S2pExec::ParseArguments(span args) { "help", no_argument, nullptr, 'H' }, { "hex-only", no_argument, nullptr, 'x' }, { "hex-output-file", required_argument, nullptr, 'T' }, - { "no-request-sense", no_argument, nullptr, 'n' }, + { "request-sense", no_argument, nullptr, 'R' }, { "log-level", required_argument, nullptr, 'L' }, { "reset-bus", no_argument, nullptr, 'r' }, { "scsi-target", required_argument, nullptr, 'i' }, @@ -119,14 +119,14 @@ bool S2pExec::ParseArguments(span args) // Resetting these is important for the interactive mode command.clear(); data.clear(); - request_sense = true; + request_sense = false; reset_bus = false; binary_input_filename.clear(); hex_input_filename.clear(); optind = 1; int opt; - while ((opt = getopt_long(static_cast(args.size()), args.data(), "b:B:c:d:f:F:h:i:o:L:T:Hnrvx", + while ((opt = getopt_long(static_cast(args.size()), args.data(), "b:B:c:d:f:F:h:i:o:L:T:HrRvx", options.data(), nullptr)) != -1) { switch (opt) { case 'b': @@ -175,10 +175,6 @@ bool S2pExec::ParseArguments(span args) log_level = optarg; break; - case 'n': - request_sense = false; - break; - case 'o': tout = optarg; break; @@ -187,6 +183,10 @@ bool S2pExec::ParseArguments(span args) reset_bus = true; break; + case 'R': + request_sense = true; + break; + case 'T': hex_output_filename = optarg; break; diff --git a/doc/s2pexec.1 b/doc/s2pexec.1 index 5479b2b1..7ecb5cc8 100644 --- a/doc/s2pexec.1 +++ b/doc/s2pexec.1 @@ -15,7 +15,7 @@ s2pexec \- SCSI2Pi SCSI/SASI command executor {\fB\--hex-input-file/-t\fR \fIFILE\fR] {\fB\--hex-output-file/-T\fR \fIFILE\fR] {\fB\--timeout/-o\fR \fITIMEOUT\fR] -[\fB\--no-request-sense/-n\fR] +[\fB\--request-sense/-R\fR] [\fB\--reset-bus/-r\fR] [\fB\--hex-only/\fR] [\fB\--help/-H\fR] @@ -70,8 +70,8 @@ Optional file for data received in the DATA IN phase. The data in this file are .BR --timeout/-o\fI " "\fITIMEOUT The command timeout in seconds, default is 3 seconds. Operations like formatting may take much longer. .TP -.BR --no-request-sense/-n\fI -Do not automatically send REQUEST SENSE after an error in order to get the sense data. +.BR --request-sense/-R\fI +Automatically send REQUEST SENSE after an error in order to get the sense data. .TP .BR --reset-bus/-r\fI Reset the bus.