diff options
Diffstat (limited to 'doc')
-rw-r--r-- | doc/sg3_utils_json.8 | 61 | ||||
-rw-r--r-- | doc/sg_inq.8 | 12 |
2 files changed, 44 insertions, 29 deletions
diff --git a/doc/sg3_utils_json.8 b/doc/sg3_utils_json.8 index 0d437470..e8080b59 100644 --- a/doc/sg3_utils_json.8 +++ b/doc/sg3_utils_json.8 @@ -231,35 +231,46 @@ character (ASCII zero and C string terminator) somehow finds its way into a field that should (according to the spec) be space padded, then the JSON output may appear truncated. .PP -Note that this JSON processing means that if a utility is aborted for -whatever reason then no JSON output will appear. With the normal, -human readable output processing, some output may appear before -the utility aborts in such bad situations. +Note that this JSON processing means that if a utility is aborted for whatever +reason then no JSON output will appear. With the normal, human readable output +processing, some output may appear before the utility aborts in such bad +situations. .SH ERRORS -No attempts has been made to translate errors into JSON form, apart -from the final "exit_status" JSON object where a value of 0 -means "no errors". Exit status values indicating a problem range -from 1 to 255. +No attempts has been made to translate errors into JSON form, apart from the +final "exit_status" JSON object where a value of 0 means "no errors". Exit +status values indicating a problem range from 1 to 255. .PP -The sg_decode_sense utility will parse SCSI sense data into JSON -form if requested. So if another utility is failing with a sense -data report (most often seen when the \fI\-\-verbose\fR option is -used). That sense data (in hex bytes) could be cut\-and\-paste -onto the command line following 'sg_decode_sense \-j ' which should -then render that sense data in JSON. +The sg_decode_sense utility will parse SCSI sense data into JSON form if +requested. So if another utility is failing with a sense data report (most +often seen when the \fI\-\-verbose\fR option is used). That sense data (in +hex bytes) could be cut\-and\-paste onto the command line +following 'sg_decode_sense \-j ' which should then render that sense data +in JSON. .PP -Otherwise, when a error is detected while JSON output is selected, -the error message is sent to stderr in human readable form. Typically -once an error is detected the utility will exit, first dumping -the JSON in\-memory tree as discussed above and a non\-zero exit -status will be set. The JSON output will be well formed but missing -any fields or list elements following the point that the error -was detected. +Otherwise, when a error is detected while JSON output is selected, the error +message is sent to stderr in human readable form. Typically once an error is +detected the utility will exit, first dumping the JSON in\-memory tree as +discussed above and a non\-zero exit status will be set. The JSON output will +be well formed but missing any fields or list elements following the point +that the error was detected. .PP -The summary is that when JSON output is selected and an error occurs -each utility will process the error the same way as it would if JSON -output had not been selected. In all cases error messages, in human -readable form, are sent to stderr. +The summary is that when JSON output is selected and an error occurs each +utility will process the error the same way as it would if JSON output had +not been selected. In all cases error messages, in human readable form, +are sent to stderr. +.SH INTERACTION WITH OTHER OPTIONS +As stated above, the default output is in human readable form using 7 bit +ASCII. The \fI\-\-json[=JO]\fR option is designed to be an alternative +to that human readable form. There are other alternative output formats +such as the response output as a hexadecimal sequence of bytes or +in "raw" binary; both of those take precedence over the \fI\-\-json[=JO]\fR +option. Other specialized output format (e.g. 'sg_inq \-\-export') will +usually take precedence over JSON output. +.PP +When the \fI\-\-raw\fR option is used together with the \fI\-\-inhex=FN\fR +option only the data input to the utility is interpreted as binary. So the +output format defaults to human readable form and thus can be changed to +JSON if the \fI\-\-json[=JO]\fR option is also used. .SH AUTHORS Written by Douglas Gilbert. Some utilities have been contributed, see the CREDITS file and individual source files (in the 'src' directory). diff --git a/doc/sg_inq.8 b/doc/sg_inq.8 index 9ae5c550..759d7165 100644 --- a/doc/sg_inq.8 +++ b/doc/sg_inq.8 @@ -6,10 +6,10 @@ sg_inq \- issue SCSI INQUIRY command and/or decode its response [\fI\-\-ata\fR] [\fI\-\-block=0|1\fR] [\fI\-\-cmddt\fR] [\fI\-\-descriptors\fR] [\fI\-\-export\fR] [\fI\-\-extended\fR] [\fI\-\-force\fR] [\fI\-\-help\fR] [\fI\-\-hex\fR] [\fI\-\-id\fR] -[\fI\-\-inhex=FN\fR] [\fI\-\-len=LEN\fR] [\fI\-\-long\fR] -[\fI\-\-maxlen=LEN\fR] [\fI\-\-only\fR] [\fI\-\-page=PG\fR] [\fI\-\-raw\fR] -[\fI\-\-vendor\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] [\fI\-\-vpd\fR] -\fIDEVICE\fR +[\fI\-\-inhex=FN\fR] [\fI\-\-json[=JO]\fR] [\fI\-\-len=LEN\fR] +[\fI\-\-long\fR] [\fI\-\-maxlen=LEN\fR] [\fI\-\-only\fR] [\fI\-\-page=PG\fR] +[\fI\-\-raw\fR] [\fI\-\-vendor\fR] [\fI\-\-verbose\fR] [\fI\-\-version\fR] +[\fI\-\-vpd\fR] \fIDEVICE\fR .PP .B sg_inq [\fI\-36\fR] [\fI\-a\fR] [\fI\-A\fR] [\fI\-b\fR] [\fI\-\-B=0|1\fR] @@ -158,6 +158,10 @@ byte each of which is whitespace or comma separated. Anything from and including a hash mark to the end of a line is ignored. If the \fI\-\-raw\fR option is also given then \fIFN\fR is treated as binary. .TP +\fB\-j\fR, \fB\-\-json[\fR=\fIJO\fR] +output is in JSON format instead of human readable form. This is an +EXPERIMENTAL feature; see sg3_utils_json manpage. +.TP \fB\-l\fR, \fB\-\-len\fR=\fILEN\fR the number \fILEN\fR is the "allocation length" field in the INQUIRY cdb. This is the (maximum) length of the response returned by the device. The |