diff options
author | Keith Bostic <keith@wiredtiger.com> | 2012-10-17 09:45:54 +0000 |
---|---|---|
committer | Keith Bostic <keith@wiredtiger.com> | 2012-10-17 09:45:54 +0000 |
commit | 78c836a4e121c7399d023139aeb3895a2aa86245 (patch) | |
tree | 13a76e3616a4207fe10656292f746beddaf8b673 | |
parent | 61a4ff2a9d44d08ce9c136281bcd46b5657c0ea0 (diff) | |
download | mongo-78c836a4e121c7399d023139aeb3895a2aa86245.tar.gz |
Add backup, config and statistics object types, that way we'll
report an error for "verify statistics:foo" instead of trying
to verify a the URI "table:statistics:foo".
-rw-r--r-- | src/utilities/util_main.c | 46 |
1 files changed, 18 insertions, 28 deletions
diff --git a/src/utilities/util_main.c b/src/utilities/util_main.c index 4a17a1f5802..6b8b91fa2db 100644 --- a/src/utilities/util_main.c +++ b/src/utilities/util_main.c @@ -231,43 +231,33 @@ util_name(const char *s, const char *type, u_int flags) char *name; copy = 0; - if (WT_PREFIX_MATCH(s, "colgroup:")) { - if (!(flags & UTIL_COLGROUP_OK)) { - fprintf(stderr, - "%s: %s: \"colgroup\" type not supported\n", - progname, command); - return (NULL); - } + if (WT_PREFIX_MATCH(s, "backup:")) { + goto type_err; + } else if (WT_PREFIX_MATCH(s, "colgroup:")) { + if (!(flags & UTIL_COLGROUP_OK)) + goto type_err; copy = 1; + } else if (WT_PREFIX_MATCH(s, "config:")) { + goto type_err; } else if (WT_PREFIX_MATCH(s, "file:")) { - if (!(flags & UTIL_FILE_OK)) { - fprintf(stderr, - "%s: %s: \"file\" type not supported\n", - progname, command); - return (NULL); - } + if (!(flags & UTIL_FILE_OK)) + goto type_err; copy = 1; } else if (WT_PREFIX_MATCH(s, "index:")) { - if (!(flags & UTIL_INDEX_OK)) { - fprintf(stderr, - "%s: %s: \"index\" type not supported\n", - progname, command); - return (NULL); - } + if (!(flags & UTIL_INDEX_OK)) + goto type_err; copy = 1; } else if (WT_PREFIX_MATCH(s, "lsm:")) { - if (!(flags & UTIL_LSM_OK)) { - fprintf(stderr, - "%s: %s: \"lsm\" type not supported\n", - progname, command); - return (NULL); - } + if (!(flags & UTIL_LSM_OK)) + goto type_err; copy = 1; + } else if (WT_PREFIX_MATCH(s, "statistics:")) { + goto type_err; } else if (WT_PREFIX_MATCH(s, "table:")) { if (!(flags & UTIL_TABLE_OK)) { - fprintf(stderr, - "%s: %s: \"table\" type not supported\n", - progname, command); +type_err: fprintf(stderr, + "%s: %s: unsupported object type: %s\n", + progname, command, s); return (NULL); } copy = 1; |