[PATCH] add an option to htags for specifing "?view=" in viewcvs URL
Hideki IWAMOTO <[email protected]>
| Newsgroups | gmane.comp.gnu.global.bugs |
|---|---|
| Message-ID | <[email protected]> |
Hi. The attached patch adds an option to htags for specifing the value of parameter "view" in viewcvs URL. "?view=log" is required when accessing the viewvc server that default_file_view configuration option is not set to "log". diffstat: htags/htags.c | 6 ++++++ htags/htags.h | 1 + htags/manual.in | 2 ++ htags/src2html.c | 4 ++++ 4 files changed, 13 insertions(+) -- Hideki IWAMOTO <[email protected]> _______________________________________________ Bug-global mailing list [email protected] https://lists.gnu.org/mailman/listinfo/bug-global
htags-cvsweb-view-opt.patch
(application/octet-stream, 3.5 KB)
Index: htags/htags.c
===================================================================
RCS file: /sources/global/global/htags/htags.c,v
retrieving revision 1.230
diff -u -p -r1.230 htags.c
--- htags/htags.c 15 Dec 2016 17:01:06 -0000 1.230
+++ htags/htags.c 16 Dec 2016 14:05:42 -0000
@@ -142,6 +142,7 @@ const char *main_func = "main";
const char *cvsweb_url;
int use_cvs_module;
const char *cvsweb_cvsroot;
+const char *cvsweb_view;
const char *gtagslabel;
const char *title;
const char *insert_header; /* --insert-header=<file> */
@@ -312,12 +313,14 @@ static struct option const long_options[
#define OPT_HTML_HEADER 140
#define OPT_CALL_TREE 141
#define OPT_CALLEE_TREE 142
+#define OPT_CVSWEB_VIEW 143
{"auto-completion", optional_argument, NULL, OPT_AUTO_COMPLETION},
{"call-tree", required_argument, NULL, OPT_CALL_TREE},
{"callee-tree", required_argument, NULL, OPT_CALLEE_TREE},
{"cflow", required_argument, NULL, OPT_CFLOW},
{"cvsweb", required_argument, NULL, OPT_CVSWEB},
{"cvsweb-cvsroot", required_argument, NULL, OPT_CVSWEB_CVSROOT},
+ {"cvsweb-view", required_argument, NULL, OPT_CVSWEB_VIEW},
{"gtagsconf", required_argument, NULL, OPT_GTAGSCONF},
{"gtagslabel", required_argument, NULL, OPT_GTAGSLABEL},
{"html-header", required_argument,NULL, OPT_HTML_HEADER},
@@ -1137,6 +1140,9 @@ main(int argc, char **argv)
case OPT_CVSWEB_CVSROOT:
cvsweb_cvsroot = optarg;
break;
+ case OPT_CVSWEB_VIEW:
+ cvsweb_view = optarg;
+ break;
case OPT_GTAGSCONF:
case OPT_GTAGSLABEL:
/* These options are already parsed in preparse_options() */
Index: htags/htags.h
===================================================================
RCS file: /sources/global/global/htags/htags.h,v
retrieving revision 1.46
diff -u -p -r1.46 htags.h
--- htags/htags.h 22 Jun 2015 06:42:44 -0000 1.46
+++ htags/htags.h 16 Dec 2016 14:05:42 -0000
@@ -106,6 +106,7 @@ extern const char *main_func;
extern const char *cvsweb_url;
extern int use_cvs_module;
extern const char *cvsweb_cvsroot;
+extern const char *cvsweb_view;
extern const char *gtagslabel;
extern const char *title;
extern const char *insert_header;
Index: htags/manual.in
===================================================================
RCS file: /sources/global/global/htags/manual.in,v
retrieving revision 1.164
diff -u -p -r1.164 manual.in
--- htags/manual.in 24 Nov 2016 03:08:19 -0000 1.164
+++ htags/manual.in 16 Dec 2016 14:05:42 -0000
@@ -79,6 +79,8 @@
the content of @file{CVS/Repository} is used as the relative path from the base.
@item{@option{--cvsweb-cvsroot} @arg{cvsroot}}
Specify cvsroot in cvsweb URL.
+ @item{@option{--cvsweb-view} @arg{view}}
+ Specify value of parameter @samp{view} in cvsweb URL.
@item{@option{-D}, @option{--dynamic}}
Generate a tag list dynamically using CGI program.
Though this option decreases both the size and generation time of
Index: htags/src2html.c
===================================================================
RCS file: /sources/global/global/htags/src2html.c,v
retrieving revision 1.86
diff -u -p -r1.86 src2html.c
--- htags/src2html.c 15 Dec 2016 13:32:36 -0000 1.86
+++ htags/src2html.c 16 Dec 2016 14:05:42 -0000
@@ -844,6 +844,10 @@ src2html(const char *src, const char *ht
strbuf_puts(sb, "?cvsroot=");
strbuf_puts(sb, cvsweb_cvsroot);
}
+ if (cvsweb_view) {
+ strbuf_puts(sb, "?view=");
+ strbuf_puts(sb, cvsweb_view);
+ }
fputs(quote_space, out);
fputs(gen_href_begin_simple(strbuf_value(sb)), out);
fputs(cvslink_begin, out);