stagit-gopher-index: add -b to usage, print header on first repo dir - stagit-g… | |
git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2h… | |
Log | |
Files | |
Refs | |
Tags | |
README | |
LICENSE | |
--- | |
commit 7b11bb8d6ef91800ade2d63e67c570a6047ff189 | |
parent bdb40a1c6bacf3955f49c6054504fb7f5a93c8fd | |
Author: Hiltjo Posthuma <[email protected]> | |
Date: Fri, 23 Jun 2017 12:39:05 +0200 | |
stagit-gopher-index: add -b to usage, print header on first repo dir | |
Diffstat: | |
M stagit-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"); |