summaryrefslogtreecommitdiff
path: root/src/utilities/util_main.c
diff options
context:
space:
mode:
Diffstat (limited to 'src/utilities/util_main.c')
-rw-r--r--src/utilities/util_main.c90
1 files changed, 40 insertions, 50 deletions
diff --git a/src/utilities/util_main.c b/src/utilities/util_main.c
index d4be5a45500..6b8b91fa2db 100644
--- a/src/utilities/util_main.c
+++ b/src/utilities/util_main.c
@@ -111,6 +111,8 @@ main(int argc, char *argv[])
case 'c':
if (strcmp(command, "create") == 0)
ret = util_create(session, argc, argv);
+ else if (strcmp(command, "compact") == 0)
+ ret = util_compact(session, argc, argv);
else
ret = usage();
break;
@@ -119,8 +121,6 @@ main(int argc, char *argv[])
ret = util_drop(session, argc, argv);
else if (strcmp(command, "dump") == 0)
ret = util_dump(session, argc, argv);
- else if (strcmp(command, "dumpfile") == 0)
- ret = util_dumpfile(session, argc, argv);
else
ret = usage();
break;
@@ -193,28 +193,28 @@ usage(void)
WIREDTIGER_VERSION_MAJOR, WIREDTIGER_VERSION_MINOR);
fprintf(stderr,
"global options:\n"
- "\t-C\twiredtiger_open configuration\n"
- "\t-h\tdatabase directory\n"
- "\t-V\tdisplay library version and exit\n"
- "\t-v\tverbose\n");
+ "\t" "-C\twiredtiger_open configuration\n"
+ "\t" "-h\tdatabase directory\n"
+ "\t" "-V\tdisplay library version and exit\n"
+ "\t" "-v\tverbose\n");
fprintf(stderr,
"commands:\n"
- "\tbackup database backup\n"
- "\tcopyright copyright information\n"
- "\tcreate\t create an object\n"
- "\tdrop\t drop an object\n"
- "\tdump\t dump an object\n"
- "\tdumpfile dump a physical file in debugging format\n"
- "\tlist\t list database objects\n"
- "\tload\t load an object\n"
- "\tprintlog display the database log\n"
- "\tread\t read values from an object\n"
- "\trename\t rename an object\n"
- "\tsalvage\t salvage a file\n"
- "\tstat\t display statistics for an object\n"
- "\tupgrade\t upgrade an object\n"
- "\tverify\t verify an object\n"
- "\twrite\t write values to an object\n");
+ "\t" "backup\t database backup\n"
+ "\t" "compact\t compact an object\n"
+ "\t" "copyright copyright information\n"
+ "\t" "create\t create an object\n"
+ "\t" "drop\t drop an object\n"
+ "\t" "dump\t dump an object\n"
+ "\t" "list\t list database objects\n"
+ "\t" "load\t load an object\n"
+ "\t" "printlog display the database log\n"
+ "\t" "read\t read values from an object\n"
+ "\t" "rename\t rename an object\n"
+ "\t" "salvage\t salvage a file\n"
+ "\t" "stat\t display statistics for an object\n"
+ "\t" "upgrade\t upgrade an object\n"
+ "\t" "verify\t verify an object\n"
+ "\t" "write\t write values to an object\n");
return (EXIT_FAILURE);
}
@@ -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;