stagit-gopher

static git page generator for gopher (mirror)
git clone git://git.2f30.org/stagit-gopher
Log | Files | Refs | README | LICENSE

commit 7b11bb8d6ef91800ade2d63e67c570a6047ff189
parent bdb40a1c6bacf3955f49c6054504fb7f5a93c8fd
Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date:   Fri, 23 Jun 2017 12:39:05 +0200

stagit-gopher-index: add -b to usage, print header on first repo dir

Diffstat:
Mstagit-gopher-index.c | 7++++---
1 file changed, 4 insertions(+), 3 deletions(-)

diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c @@ -177,7 +177,7 @@ err: void usage(const char *argv0) { - fprintf(stderr, "%s [repodir...]\n", argv0); + fprintf(stderr, "%s [-b baseprefix] [repodir...]\n", argv0); exit(1); } @@ -195,8 +195,6 @@ main(int argc, char *argv[]) git_libgit2_init(); - writeheader(stdout); - for (i = 1; i < argc; i++) { if (argv[i][0] == '-') { if (argv[i][1] != 'b' || i + 1 >= argc) @@ -205,6 +203,9 @@ main(int argc, char *argv[]) continue; } + if (i == 1) + writeheader(stdout); + repodir = argv[i]; if (!realpath(repodir, repodirabs)) err(1, "realpath");