summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorColin Watson <cjwatson@debian.org>2012-02-04 21:48:25 +0000
committerColin Watson <cjwatson@debian.org>2012-02-04 21:48:25 +0000
commite37bc92f352c97c61ef63de745e43574d27b1276 (patch)
tree7cdc23cd79e73557e120ef6257f649be5d8e5e4d
parentff4cfcdd4cb85c923b4fe7218fe85a3daba99813 (diff)
downloadman-db-e37bc92f352c97c61ef63de745e43574d27b1276.tar.gz
* src/man.c (options): Add --path as an alias for -w.
(main): Running 'man -w' (etc.) without a name now prints the manpath, for compatibility with other man implementations. * NEWS: Document this.
-rw-r--r--ChangeLog7
-rw-r--r--NEWS4
-rw-r--r--src/man.c8
3 files changed, 18 insertions, 1 deletions
diff --git a/ChangeLog b/ChangeLog
index ed3bd79..981e102 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,10 @@
+Sat Feb 4 21:44:47 GMT 2012 Colin Watson <cjwatson@debian.org>
+
+ * src/man.c (options): Add --path as an alias for -w.
+ (main): Running 'man -w' (etc.) without a name now prints the
+ manpath, for compatibility with other man implementations.
+ * NEWS: Document this.
+
Thu Feb 2 18:05:16 GMT 2012 Colin Watson <cjwatson@debian.org>
* include/comp_src.h.in (comp_list): Don't handle .lzma files using
diff --git a/NEWS b/NEWS
index 6bdbda6..f6c232f 100644
--- a/NEWS
+++ b/NEWS
@@ -27,6 +27,10 @@ Major changes since man-db 2.6.0.2:
o Add support for Lzip-compressed manual pages, thanks to Matias A.
Fonzo.
+ o Running 'man -w' (with a new --path alias) without a name now
+ prints the manpath, for compatibility with other man
+ implementations. The vim viewdoc plugin makes use of this.
+
man-db 2.6.0.2 (13 April 2011)
==============================
diff --git a/src/man.c b/src/man.c
index bd1a7f2..ebe9494 100644
--- a/src/man.c
+++ b/src/man.c
@@ -280,6 +280,7 @@ static struct argp_option options[] = {
{ "apropos", 'k', 0, 0, N_("equivalent to apropos") },
{ "global-apropos", 'K', 0, 0, N_("search for text in all pages") },
{ "where", 'w', 0, 0, N_("print physical location of man page(s)") },
+ { "path", 0, 0, OPTION_ALIAS },
{ "location", 0, 0, OPTION_ALIAS },
{ "where-cat", 'W', 0, 0, N_("print physical location of cat file(s)") },
{ "location-cat", 0, 0, OPTION_ALIAS },
@@ -1162,7 +1163,12 @@ int main (int argc, char *argv[])
localnow->tm_hour == 0 && localnow->tm_min == 30)
fprintf (stderr, "gimme gimme gimme\n");
- gripe_no_name (NULL);
+ if (print_where) {
+ manp = get_manpath ("");
+ printf ("%s\n", manp);
+ exit (OK);
+ } else
+ gripe_no_name (NULL);
}
section_list = get_section_list ();