mdbx-tools: refine built-in help/usage.

Change-Id: Ia06666f48f50e088c796c85e263885ca7181c6a0
This commit is contained in:
Leonid Yuriev
2019-11-27 22:38:39 +03:00
parent 7d74aa6ae8
commit 2cfe7758cd
5 changed files with 52 additions and 35 deletions

View File

@@ -54,7 +54,15 @@ static void prstat(MDBX_stat *ms) {
static void usage(char *prog) {
fprintf(stderr,
"usage: %s [-V] [-n] [-e] [-r[r]] [-f[f[f]]] [-a|-s subdb] dbpath\n",
"usage: %s [-V] [-e] [-r[r]] [-f[f[f]]] [-a|-s name] [-n] dbpath\n"
" -V\t\tprint version and exit\n"
" -a\t\tprint stat of main DB and all subDBs\n"
" -s name\tprint stat of only the named subDB\n"
" -e\t\tshow whole DB info\n"
" -f\t\tshow GC info\n"
" -r\t\tshow readers\n"
" \t\t(default) print stat of only the main DB\n"
" -n\t\tNOSUBDIR mode for open\n",
prog);
exit(EXIT_FAILURE);
}
@@ -95,15 +103,6 @@ int main(int argc, char *argv[]) {
if (argc < 2)
usage(prog);
/* -a: print stat of main DB and all subDBs
* -s: print stat of only the named subDB
* -e: print env info
* -f: print freelist info
* -r: print reader info
* -n: use NOSUBDIR flag on env_open
* -V: print version and exit
* (default) print stat of only the main DB
*/
while ((o = getopt(argc, argv, "Vaefnrs:")) != EOF) {
switch (o) {
case 'V':