summaryrefslogtreecommitdiff
path: root/.local/bin/woman
diff options
context:
space:
mode:
Diffstat (limited to '.local/bin/woman')
-rwxr-xr-x.local/bin/woman24
1 files changed, 14 insertions, 10 deletions
diff --git a/.local/bin/woman b/.local/bin/woman
index bbabc8e..c68728d 100755
--- a/.local/bin/woman
+++ b/.local/bin/woman
@@ -1,12 +1,16 @@
-#!/bin/sh
+#!/usr/local/bin/andy
-apropos . \
-| sed -E 's/ (\([^)]+\))\s*-/\1 —/' \
-| sort \
-| osel \
-| sed 's/\s.*//' \
-| {
- IFS= read -r page
- [ -n "$page" -a ! -t 2 ] && man -Tpdf "$page" | zathura -
- [ -n "$page" -a -t 2 ] && man "$page"
+# TODO: -s flag to apropos
+
+apropos .
+| sed -E 's/ (\([^)]+\))\s*-/\1 —/'
+| sort
+| osel
+| sed 's/\s.*//'
+| read page
+
+if test -n $page -a ! -t 2 {
+ man -Tpdf $page | zathura -
+} else if test -n $page -a -t 2 {
+ man $page
}