about summary refs log tree commit diff
diff options
context:
space:
mode:
-rw-r--r--README1
-rwxr-xr-xxmandoc8
2 files changed, 9 insertions, 0 deletions
diff --git a/README b/README
index b42a9bc..d4dab55 100644
--- a/README
+++ b/README
@@ -17,6 +17,7 @@ https://github.com/voidlinux/xbps
   xlocate [-u | PATTERN] - locate files in all XBPS packages
   xlog PKG - open commit log for XBPS template
   xls PKGS... - list files contained in PKGS (including binpkgs)
+  xmandoc MANPAGE - read manpage of possibly not installed package
   xmindep PKGS... - minimize list of PKGS by removing implicit dependencies
   xnew PKG - create XBPS template template
   xnodev - list not installed -devel packages for installed packages
diff --git a/xmandoc b/xmandoc
new file mode 100755
index 0000000..7a6486e
--- /dev/null
+++ b/xmandoc
@@ -0,0 +1,8 @@
+#!/bin/sh
+# xmandoc MANPAGE - read manpage of possibly not installed package
+
+xlocate "man/man..?/$1\.[0-9]" 2>/dev/null | 
+	{ grep . || { echo "xmandoc: No entry for $1 found." 1>&2; exit 1; } } |
+	while read pkg page; do
+		xbps-query --cat=$page $pkg | mandoc -a
+	done