repo

List, download and sync packs with remote repositories
Log | Files | Refs

commit 110669539bbb56f912cbea54c0601bb81136da88
parent ce27affb8e47c3b19dc0a013dde121a4d80da3d8
Author: z3bra <willyatmailoodotorg>
Date:   Fri Dec 16 00:19:25 +0100

Add flag to specify config file on the command line

Diffstat:
repo.c | 7+++++--
1 file changed, 5 insertions(+), 2 deletions(-)
diff --git a/repo.c b/repo.c @@ -18,7 +18,7 @@ int download(char *, FILE *); void usage(char *name) { - fprintf(stderr, "usage: %s [-sl] [-r URL] [PACK..]\n", name); + fprintf(stderr, "usage: %s [-sl] [-c FILE] [-r URL] [PACK..]\n", name); exit(1); } @@ -137,7 +137,7 @@ main (int argc, char *argv[]) { int sflag = 0, lflag = 0; char *argv0, *n; - char *cfgfile = DEFCFGFILE; + char cfgfile[PATH_MAX] = DEFCFGFILE; char fn[PATH_MAX], url[PATH_MAX]; FILE *fd; struct packs plist; @@ -149,6 +149,9 @@ main (int argc, char *argv[]) TAILQ_INIT(&rlist); ARGBEGIN{ + case 'c': + snprintf(cfgfile, PATH_MAX, "%s", EARGF(usage(argv0))); + break; case 'r': addrepo(&rlist, EARGF(usage(argv0))); break;