prefix usage with the common prefix "usage: " - stagit-gopher - A git gopher frontend. (mirror)
HTML git clone git://bitreich.org/stagit-gopher/ git://enlrupgkhuxnvlhsf6lc3fziv5h2hhfrinws65d7roiv6bfj7d652fid.onion/stagit-gopher/
DIR Log
DIR Files
DIR Refs
DIR Tags
DIR README
DIR LICENSE
---
DIR commit d8c4c2c3aa23b1237f15fc3ab539419c2368989e
DIR parent 9e4bfa14ce08e666da732606187647cca6410b05
HTML Author: Hiltjo Posthuma <hiltjo@codemadness.org>
Date: Tue, 16 Aug 2022 13:22:34 +0200
prefix usage with the common prefix "usage: "
Diffstat:
M stagit-gopher-index.c | 8 +++-----
M stagit-gopher.c | 2 +-
2 files changed, 4 insertions(+), 6 deletions(-)
---
DIR diff --git a/stagit-gopher-index.c b/stagit-gopher-index.c
@@ -235,7 +235,7 @@ err:
void
usage(const char *argv0)
{
- fprintf(stderr, "%s [-b baseprefix] [repodir...]\n", argv0);
+ fprintf(stderr, "usage: %s [-b baseprefix] [repodir...]\n", argv0);
exit(1);
}
@@ -308,10 +308,8 @@ main(int argc, char *argv[])
writelog(stdout);
}
- if (!repodir) {
- fprintf(stderr, "%s [-b baseprefix] [repodir...]\n", argv[0]);
- return 1;
- }
+ if (!repodir)
+ usage(argv[0]);
/* cleanup */
git_repository_free(repo);
DIR diff --git a/stagit-gopher.c b/stagit-gopher.c
@@ -1242,7 +1242,7 @@ writerefs(FILE *fp)
void
usage(char *argv0)
{
- fprintf(stderr, "%s [-b baseprefix] [-c cachefile | -l commits] "
+ fprintf(stderr, "usage: %s [-b baseprefix] [-c cachefile | -l commits] "
"[-u baseurl] repodir\n", argv0);
exit(1);
}