summaryrefslogtreecommitdiff
path: root/src/utilities/util_main.c
diff options
context:
space:
mode:
authorMichael Cahill <michael.cahill@wiredtiger.com>2012-02-02 17:26:46 +1100
committerMichael Cahill <michael.cahill@wiredtiger.com>2012-02-02 17:26:46 +1100
commit27074676846bb2666abb06317fcf4999b71ad46b (patch)
treef72b77b66b01bec1ece9bc4b3f5b410a812ee09e /src/utilities/util_main.c
parente9652b47af8c9cf154584dd34b0d0c96badf5cab (diff)
downloadmongo-27074676846bb2666abb06317fcf4999b71ad46b.tar.gz
Have utilities work on more types of objects (e.g., "wt create colgroup:...").
refs #131
Diffstat (limited to 'src/utilities/util_main.c')
-rw-r--r--src/utilities/util_main.c20
1 files changed, 18 insertions, 2 deletions
diff --git a/src/utilities/util_main.c b/src/utilities/util_main.c
index 92712fd5dfe..7fe3015f1b9 100644
--- a/src/utilities/util_main.c
+++ b/src/utilities/util_main.c
@@ -227,7 +227,15 @@ util_name(const char *s, const char *type, u_int flags)
char *name;
copy = 0;
- if (strncmp(s, "file:", strlen("file:")) == 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);
+ }
+ copy = 1;
+ } else if (WT_PREFIX_MATCH(s, "file:")) {
if (!(flags & UTIL_FILE_OK)) {
fprintf(stderr,
"%s: %s: \"file\" type not supported\n",
@@ -235,7 +243,15 @@ util_name(const char *s, const char *type, u_int flags)
return (NULL);
}
copy = 1;
- } else if (strncmp(s, "table:", strlen("table:")) == 0) {
+ } 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);
+ }
+ copy = 1;
+ } else if (WT_PREFIX_MATCH(s, "table:")) {
if (!(flags & UTIL_TABLE_OK)) {
fprintf(stderr,
"%s: %s: \"table\" type not supported\n",