author | Lars Hjemli <hjemli@gmail.com> | 2009-08-23 17:36:45 (UTC) |
---|---|---|
committer | Lars Hjemli <hjemli@gmail.com> | 2009-08-24 08:22:58 (UTC) |
commit | 50d5af3adcdd90424b70e9472af24356ed50aa9b (patch) (unidiff) | |
tree | 758484a13b8226f64da1e7bde04bb5333beb1e0b | |
parent | 00466376922e2f7db02b3c335d46af5eb8991c49 (diff) | |
download | cgit-50d5af3adcdd90424b70e9472af24356ed50aa9b.zip cgit-50d5af3adcdd90424b70e9472af24356ed50aa9b.tar.gz cgit-50d5af3adcdd90424b70e9472af24356ed50aa9b.tar.bz2 |
Add support for --scan-path command line option
This is an alias for --scan-tree (which might be deprecated in the
future).
Signed-off-by: Lars Hjemli <hjemli@gmail.com>
-rw-r--r-- | cgit.c | 3 |
1 files changed, 2 insertions, 1 deletions
@@ -534,33 +534,34 @@ static void cgit_parse_args(int argc, const char **argv) | |||
534 | ctx.qry.repo = xstrdup(argv[i]+7); | 534 | ctx.qry.repo = xstrdup(argv[i]+7); |
535 | } | 535 | } |
536 | if (!strncmp(argv[i], "--page=", 7)) { | 536 | if (!strncmp(argv[i], "--page=", 7)) { |
537 | ctx.qry.page = xstrdup(argv[i]+7); | 537 | ctx.qry.page = xstrdup(argv[i]+7); |
538 | } | 538 | } |
539 | if (!strncmp(argv[i], "--head=", 7)) { | 539 | if (!strncmp(argv[i], "--head=", 7)) { |
540 | ctx.qry.head = xstrdup(argv[i]+7); | 540 | ctx.qry.head = xstrdup(argv[i]+7); |
541 | ctx.qry.has_symref = 1; | 541 | ctx.qry.has_symref = 1; |
542 | } | 542 | } |
543 | if (!strncmp(argv[i], "--sha1=", 7)) { | 543 | if (!strncmp(argv[i], "--sha1=", 7)) { |
544 | ctx.qry.sha1 = xstrdup(argv[i]+7); | 544 | ctx.qry.sha1 = xstrdup(argv[i]+7); |
545 | ctx.qry.has_sha1 = 1; | 545 | ctx.qry.has_sha1 = 1; |
546 | } | 546 | } |
547 | if (!strncmp(argv[i], "--ofs=", 6)) { | 547 | if (!strncmp(argv[i], "--ofs=", 6)) { |
548 | ctx.qry.ofs = atoi(argv[i]+6); | 548 | ctx.qry.ofs = atoi(argv[i]+6); |
549 | } | 549 | } |
550 | if (!strncmp(argv[i], "--scan-tree=", 12)) { | 550 | if (!strncmp(argv[i], "--scan-tree=", 12) || |
551 | !strncmp(argv[i], "--scan-path=", 12)) { | ||
551 | scan++; | 552 | scan++; |
552 | scan_tree(argv[i] + 12); | 553 | scan_tree(argv[i] + 12); |
553 | } | 554 | } |
554 | } | 555 | } |
555 | if (scan) { | 556 | if (scan) { |
556 | qsort(cgit_repolist.repos, cgit_repolist.count, | 557 | qsort(cgit_repolist.repos, cgit_repolist.count, |
557 | sizeof(struct cgit_repo), cmp_repos); | 558 | sizeof(struct cgit_repo), cmp_repos); |
558 | print_repolist(stdout, &cgit_repolist, 0); | 559 | print_repolist(stdout, &cgit_repolist, 0); |
559 | exit(0); | 560 | exit(0); |
560 | } | 561 | } |
561 | } | 562 | } |
562 | 563 | ||
563 | static int calc_ttl() | 564 | static int calc_ttl() |
564 | { | 565 | { |
565 | if (!ctx.repo) | 566 | if (!ctx.repo) |
566 | return ctx.cfg.cache_root_ttl; | 567 | return ctx.cfg.cache_root_ttl; |