diff options
author | dim <dim@FreeBSD.org> | 2016-02-21 13:03:58 +0000 |
---|---|---|
committer | dim <dim@FreeBSD.org> | 2016-02-21 13:03:58 +0000 |
commit | 579b7ad49fdbcb4dd1e016603c5d0774b32c12d1 (patch) | |
tree | f95ee84acdd587171cdb74c424bce73bb337a1a2 | |
parent | b01ee87c2b5517e378371d46e9b635dab4fa15a5 (diff) | |
download | FreeBSD-src-579b7ad49fdbcb4dd1e016603c5d0774b32c12d1.zip FreeBSD-src-579b7ad49fdbcb4dd1e016603c5d0774b32c12d1.tar.gz |
Fix "invalid type '(null)'" usage messages in zfs(8) and zpool(8).
Currently, zfs(8) and zpool(8) print "invalid type '(null)'" or similar
messages, if you pass in invalid types, sources or column names for "zfs
get", "zfs list" and "zpool get". This is because the commands use
getsubopt(3), and in case of failure, they print 'value', which is NULL
when sub options don't match.
They should print 'suboptarg' instead, which is the documented way to
get at the non-matching sub option value.
Reviewed by: smh
MFC after: 3 days
Differential Revision: https://reviews.freebsd.org/D5365
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zfs/zfs_main.c | 8 | ||||
-rw-r--r-- | cddl/contrib/opensolaris/cmd/zpool/zpool_main.c | 2 |
2 files changed, 5 insertions, 5 deletions
diff --git a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c index 9db2f73..99f9a1e 100644 --- a/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c +++ b/cddl/contrib/opensolaris/cmd/zfs/zfs_main.c @@ -1713,7 +1713,7 @@ zfs_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid column name " - "'%s'\n"), value); + "'%s'\n"), suboptarg); usage(B_FALSE); } } @@ -1750,7 +1750,7 @@ zfs_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid source " - "'%s'\n"), value); + "'%s'\n"), suboptarg); usage(B_FALSE); } } @@ -1786,7 +1786,7 @@ zfs_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid type '%s'\n"), - value); + suboptarg); usage(B_FALSE); } } @@ -3156,7 +3156,7 @@ zfs_do_list(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid type '%s'\n"), - value); + suboptarg); usage(B_FALSE); } } diff --git a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c index 6e1670e..c666263 100644 --- a/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c +++ b/cddl/contrib/opensolaris/cmd/zpool/zpool_main.c @@ -5431,7 +5431,7 @@ zpool_do_get(int argc, char **argv) default: (void) fprintf(stderr, gettext("invalid column name " - "'%s'\n"), value); + "'%s'\n"), suboptarg); usage(B_FALSE); } } |