Commit 0c42d594 authored by Yoni Fogel's avatar Yoni Fogel

Re-ordered options

git-svn-id: file:///svn/tokudb@1041 c7de825b-a66e-492c-adef-691d508d4ae1
parent ee6adf09
...@@ -60,25 +60,41 @@ int main(int argc, char *argv[]) { ...@@ -60,25 +60,41 @@ int main(int argc, char *argv[]) {
while ((ch = getopt(argc, argv, "klNpRrVd:f:h:P:s:")) != EOF) { while ((ch = getopt(argc, argv, "klNpRrVd:f:h:P:s:")) != EOF) {
switch (ch) { switch (ch) {
case ('d'): {
ERRORX("-%c option not supported.\n", ch);
goto error;
}
case ('f'): {
if (freopen(optarg, "w", stdout) == NULL) {
fprintf(stderr,
"%s: %s: reopen: %s\n",
g.progname, optarg, strerror(errno));
goto error;
}
break;
}
case ('h'): {
g.homedir = optarg;
break;
}
case ('k'): { case ('k'): {
ERRORX("-%c option not supported.\n", ch); ERRORX("-%c option not supported.\n", ch);
goto error; goto error;
} }
case ('l'): { case ('l'): {
//TODO: Implement (Requires master database support) //TODO: Implement (Requires master database support)
ERRORX("-%c option not supported.\n", ch); ERRORX("-%c option not supported.\n", ch); //YET!
goto error; goto error;
} }
case ('N'): { case ('N'): {
ERRORX("-%c option not supported.\n", ch); ERRORX("-%c option not supported.\n", ch);
goto error; goto error;
} }
case ('T'): { case ('P'): {
g.plaintext = true; /* Clear password. */
g.leadingspace = false; memset(optarg, 0, strlen(optarg));
g.header = false; ERRORX("-%c option not supported.\n", ch);
g.footer = false; goto error;
break;
} }
case ('p'): { case ('p'): {
g.plaintext = true; g.plaintext = true;
...@@ -100,37 +116,21 @@ int main(int argc, char *argv[]) { ...@@ -100,37 +116,21 @@ int main(int argc, char *argv[]) {
ERRORX("-%c option not supported.\n", ch); ERRORX("-%c option not supported.\n", ch);
goto error; goto error;
} }
case ('s'): {
g.subdatabase = optarg;
goto error;
}
case ('V'): { case ('V'): {
printf("%s\n", db_version(NULL, NULL, NULL)); printf("%s\n", db_version(NULL, NULL, NULL));
goto cleanup; goto cleanup;
} }
case ('d'): { case ('T'): {
ERRORX("-%c option not supported.\n", ch); g.plaintext = true;
goto error; g.leadingspace = false;
} g.header = false;
case ('f'): { g.footer = false;
if (freopen(optarg, "w", stdout) == NULL) {
fprintf(stderr,
"%s: %s: reopen: %s\n",
g.progname, optarg, strerror(errno));
goto error;
}
break;
}
case ('h'): {
g.homedir = optarg;
break; break;
} }
case ('P'): {
/* Clear password. */
memset(optarg, 0, strlen(optarg));
ERRORX("-%c option not supported.\n", ch);
goto error;
}
case ('s'): {
g.subdatabase = optarg;
goto error;
}
case ('?'): case ('?'):
default: { default: {
g.exitcode = usage(); g.exitcode = usage();
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment