diff options
author | Colin Watson <cjwatson@debian.org> | 2012-02-04 21:48:25 +0000 |
---|---|---|
committer | Colin Watson <cjwatson@debian.org> | 2012-02-04 21:48:25 +0000 |
commit | e37bc92f352c97c61ef63de745e43574d27b1276 (patch) | |
tree | 7cdc23cd79e73557e120ef6257f649be5d8e5e4d /src | |
parent | ff4cfcdd4cb85c923b4fe7218fe85a3daba99813 (diff) |
* 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.
Diffstat (limited to 'src')
-rw-r--r-- | src/man.c | 8 |
1 files changed, 7 insertions, 1 deletions
@@ -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 (); |