Skip to content
Snippets Groups Projects
Commit c96aa5c9 authored by Daniel Salzman's avatar Daniel Salzman Committed by Libor Peltan
Browse files

kjournalprint parameters

parent 4509acdd
Branches
Tags
1 merge request!616Journal lmdb joint
......@@ -6,24 +6,26 @@ kjournalprint – Knot DNS journal print utility
Synopsis
--------
:program:`kjournalprint` [*parameters*] *journal* *zone_name*
:program:`kjournalprint` [*options*] *journal_db* *zone_name*
Description
-----------
Program requires journal. As default, changes are colored for terminal.
The program prints zone history stored in a journal database. As default,
changes are colored for terminal.
Parameters
..........
**-n**, **--no-color**
Removes changes coloring.
Options
.......
**-l**, **--limit** *limit*
Limits the number of displayed changes.
**-t**, **--list-zones**
Instead of reading jurnal, display the list of zones in the DB (*zone_name* not needed)
**-n**, **--no-color**
Removes changes coloring.
**-z**, **--zone-list**
Instead of reading jurnal, display the list of zones in the DB.
(*zone_name* not needed)
**-h**, **--help**
Print the program help.
......@@ -31,25 +33,21 @@ Parameters
**-V**, **--version**
Print the program version.
Journal
.......
Requires journal in the form of path/zone-name.db
Parameters
..........
Zone name
.........
*journal_db*
A path to the journal database.
Requires name of the zone contained in the journal.
*zone_name*
A name of the zone to print the history for.
Examples
--------
Last (*most recent*) 5 changes without colors
.............................................
::
Last (most recent) 5 changes without colors::
$ kjournalprint -nl 5 example.com.db example.com.
$ kjournalprint -nl 5 /var/lib/knot/journal example.com.
See Also
--------
......
......@@ -32,13 +32,13 @@
static void print_help(void)
{
printf("Usage: %s [parameter] <journal> <zone_name>\n"
printf("Usage: %s [parameter] <journal_db> <zone_name>\n"
"\n"
"Parameters:\n"
" -n, --no-color Get output without terminal coloring.\n"
" -l, --limit <Limit> Read only x newest changes.\n"
" -t, --list-zones Instead of reading jurnal, display the list\n"
" of zones in the DB (<zone_name> not needed)\n",
" -l, --limit <num> Read only <num> newest changes.\n"
" -n, --no-color Get output without terminal coloring.\n"
" -z, --zone-list Instead of reading jurnal, display the list\n"
" of zones in the DB (<zone_name> not needed).\n",
PROGRAM_NAME);
}
......@@ -167,20 +167,17 @@ int main(int argc, char *argv[])
bool color = true, justlist = false;
struct option opts[] = {
{ "list-zones", no_argument, NULL, 't' },
{ "limit", required_argument, NULL, 'l' },
{ "no-color", no_argument, NULL, 'n' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
{ "limit", required_argument, NULL, 'l' },
{ "no-color", no_argument, NULL, 'n' },
{ "zone-list", no_argument, NULL, 'z' },
{ "help", no_argument, NULL, 'h' },
{ "version", no_argument, NULL, 'V' },
{ NULL }
};
int opt = 0;
while ((opt = getopt_long(argc, argv, "tl:nhV", opts, NULL)) != -1) {
while ((opt = getopt_long(argc, argv, "l:nzhV", opts, NULL)) != -1) {
switch (opt) {
case 't':
justlist = true;
break;
case 'l':
if (str_to_u32(optarg, &limit) != KNOT_EOK) {
print_help();
......@@ -190,6 +187,9 @@ int main(int argc, char *argv[])
case 'n':
color = false;
break;
case 'z':
justlist = true;
break;
case 'h':
print_help();
return EXIT_SUCCESS;
......
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