diff options
author | Douglas Gilbert <dgilbert@interlog.com> | 2022-06-27 18:26:54 +0000 |
---|---|---|
committer | Douglas Gilbert <dgilbert@interlog.com> | 2022-06-27 18:26:54 +0000 |
commit | 30842a3103045e471ec8169f09135bb6766e5e1d (patch) | |
tree | a37d6d0bc773726fff04c163457d3bb22e6efa71 /src/sg_get_lba_status.c | |
parent | 2e225c87784735360e9619766efe06782179a86a (diff) | |
download | sg3_utils-30842a3103045e471ec8169f09135bb6766e5e1d.tar.gz |
more JSON work: sense data and vpd device id, start on sg_vpd
git-svn-id: https://svn.bingwo.ca/repos/sg3_utils/trunk@956 6180dd3e-e324-4e3e-922d-17de1ae2f315
Diffstat (limited to 'src/sg_get_lba_status.c')
-rw-r--r-- | src/sg_get_lba_status.c | 16 |
1 files changed, 12 insertions, 4 deletions
diff --git a/src/sg_get_lba_status.c b/src/sg_get_lba_status.c index 1612aaac..d85c5231 100644 --- a/src/sg_get_lba_status.c +++ b/src/sg_get_lba_status.c @@ -35,7 +35,7 @@ * device. */ -static const char * version_str = "1.27 20220616"; /* sbc5r01 */ +static const char * version_str = "1.28 20220626"; /* sbc5r01 */ #define MY_NAME "sg_get_lba_status" @@ -106,7 +106,8 @@ usage() " assumed to be ASCII hex or, if --raw, " "in binary\n" " --json[=JO]|-j[JO] output in JSON instead of human " - "readable text\n" + "readable text.\n" + " Use --json=? for JSON help\n" " --lba=LBA|-l LBA starting LBA (logical block address) " "(def: 0)\n" " --maxlen=LEN|-m LEN max response length (allocation " @@ -291,8 +292,15 @@ main(int argc, char * argv[]) break; case 'j': if (! sgj_init_state(&json_st, optarg)) { - pr2serr("bad argument to --json= option, unrecognized " - "character '%c'\n", json_st.first_bad_char); + int bad_char = json_st.first_bad_char; + char e[1500]; + + if (bad_char) { + pr2serr("bad argument to --json= option, unrecognized " + "character '%c'\n\n", bad_char); + } + sg_json_usage(0, e, sizeof(e)); + pr2serr("%s", e); return SG_LIB_SYNTAX_ERROR; } break; |