summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--main.c16
-rw-r--r--man.15
2 files changed, 18 insertions, 3 deletions
diff --git a/main.c b/main.c
index 1cc427a4..190e6171 100644
--- a/main.c
+++ b/main.c
@@ -448,8 +448,20 @@ main(int argc, char *argv[])
/* man(1): Resolve each name individually. */
if (search.argmode == ARG_NAME) {
- if (argc < 1)
- usage(ARG_NAME);
+ if (argc < 1) {
+ if (outmode != OUTMODE_FLN)
+ usage(ARG_NAME);
+ if (conf.manpath.sz == 0) {
+ warnx("The manpath is empty.");
+ mandoc_msg_setrc(MANDOCLEVEL_BADARG);
+ } else {
+ for (i = 0; i + 1 < conf.manpath.sz; i++)
+ printf("%s:", conf.manpath.paths[i]);
+ printf("%s\n", conf.manpath.paths[i]);
+ }
+ manconf_free(&conf);
+ return (int)mandoc_msg_getrc();
+ }
for (res = NULL, ressz = 0; argc > 0; argc--, argv++) {
(void)mansearch(&search, &conf.manpath,
1, argv, &resn, &resnsz);
diff --git a/man.1 b/man.1
index 26792343..814bee09 100644
--- a/man.1
+++ b/man.1
@@ -3,7 +3,7 @@
.\" Copyright (c) 1989, 1990, 1993
.\" The Regents of the University of California. All rights reserved.
.\" Copyright (c) 2003, 2007, 2008, 2014 Jason McIntyre <jmc@openbsd.org>
-.\" Copyright (c) 2010, 2011, 2014-2018 Ingo Schwarze <schwarze@openbsd.org>
+.\" Copyright (c) 2010, 2011, 2014-2020 Ingo Schwarze <schwarze@openbsd.org>
.\"
.\" Redistribution and use in source and binary forms, with or without
.\" modification, are permitted provided that the following conditions
@@ -199,6 +199,9 @@ Kernel internals.
.It Fl w
List the pathnames of all matching manual pages instead of displaying
any of them.
+If no
+.Ar name
+is given, list the directories that would be searched.
.El
.Pp
The options