dag

Djmoch's Auto Generator
git clone git://git.danielmoch.com/dag.git
Log | Files | Refs | README | LICENSE

commit 286b0fd897b37c3558c8a818da3123110b4ba7a1
parent d4df6f3674eaf673d5b4808514cd8ab01b94e6c7
Author: Daniel Moch <daniel@danielmoch.com>
Date:   Sun, 28 Nov 2021 06:42:07 -0500

dagindex: Convert -x argument to a flag

Diffstat:
Mdagindex.1 | 13++++---------
Mdagindex.c | 4++--
2 files changed, 6 insertions(+), 11 deletions(-)

diff --git a/dagindex.1 b/dagindex.1 @@ -10,6 +10,7 @@ .Fl Vhv .Nm .Fl A +.Op Fl x .Fl t Ar title .Fl s Ar slug .Fl p Ar date_published @@ -17,7 +18,6 @@ .Op Fl u Ar date_updated .Op Fl c Ar category .Op Fl d Ar description -.Op Fl x Ar sitemap_only .Nm .Fl G .Fl o Ar fmt @@ -57,6 +57,9 @@ Consult the index database to print a formatted index file to stdout. .Pp Append mode options: .Bl -tag -width Ds +.It Fl x +If this flag is provided, the current index entry is only printed +in sitemaps, not in HTML or RSS indexes. .It Fl t Ar title Use .Ar title @@ -94,14 +97,6 @@ as the category of the entry to be added to the database. Use .Ar description as the description of the entry to be added to the database. -.It Fl x Ar sitemap_only -Use the value of -.Ar sitemap_only -to control whether the entry should only be printed in sitemaps -(i.e., whether the entry should be excluded from HTML indexes and -RSS feeds). -A value of 0 means to print the entry in all indexes. -A value of 1 means to print the entry only in sitemaps. .El .Pp Generate mode options: diff --git a/dagindex.c b/dagindex.c @@ -119,7 +119,7 @@ main(int argc, char **argv) argv0 = basename(argv[0]); - while ((ch = getopt(argc, argv, "AGVa:c:d:f:hl:o:p:r:s:t:u:vx:")) != -1) { + while ((ch = getopt(argc, argv, "AGVa:c:d:f:hl:o:p:r:s:t:u:vx")) != -1) { switch (ch) { case 'A': if (mode != NONE) { @@ -212,7 +212,7 @@ main(int argc, char **argv) warnx("specifying -x without -A makes no sense"); usage(ERR_ARGS); } - sitemap_only = atoi(optarg); + sitemap_only = 1; break; default: usage(ERR_UNKNOWN_OPTION);