Skip to content

Commit

Permalink
mxqdump: List switch -a/--all for jobs-options in usage
Browse files Browse the repository at this point in the history
With `mxqdump`, currently, reading the usage, it’s not clear how to dump
all jobs in a group without any filtering on the status, which defaults
to *running*. The code actually check if `arg_all` is set, meaning the
switch `-a`/`--all` is passed. So, document that in the usage.

Instead of `-a`/`--all` also `--status=all` or `--status=any` would be
possible, but also take a different code path. So, only document
`-a`/`--all`.

Passing `--debug` shows the code paths taken:

    $ mxqdump --debug --jobs -g 472581 -a
    mxqdump mxqdump.c:737:main(): MySQL: Connection to database established.
    mxqdump mxqdump.c:747:main(): DEBUG: DO: print all jobs in group_id=472581
    […]
    $ mxqdump --debug --jobs -g 472581 --status=all # or any
    mxqdump mxqdump.c:737:main(): MySQL: Connection to database established.
    mxqdump mxqdump.c:754:main(): DEBUG: DO: print jobs in group_id=472581 with status='invalid(18446744073709551614)'
    […]

Fixes: #74
  • Loading branch information
pmenzel committed Sep 1, 2021
1 parent 66aeeb6 commit 24260b3
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions mxqdump.c
Original file line number Diff line number Diff line change
Expand Up @@ -60,7 +60,9 @@ static void print_usage(void)
"\n\n"
"[jobs-options]:\n"
" -u, --user [username|uid] filter user/everybodys jobs (default: own uid)\n"
" -a, --all no user filter - dump all jobs with status running\n"
" -g, --group-id <group-id> filter jobs in group with <group-id>\n"
" -a, --all no status filter - dump all jobs\n"
" -s, --status <job-status> filter jobs with <job-status> (default: running)\n"
" (only available when --group-id is set)\n"
"\n"
Expand Down

0 comments on commit 24260b3

Please sign in to comment.