summaryrefslogtreecommitdiff
path: root/.local/bin/woman
diff options
context:
space:
mode:
authorThomas Voss <mail@thomasvoss.com> 2023-12-06 01:30:57 +0100
committerThomas Voss <mail@thomasvoss.com> 2023-12-06 01:30:57 +0100
commit02e4686ccd7c95c6df855be61496c75c92b11396 (patch)
tree10ef22afb440b6f91e695d25677f130a5a79f75f /.local/bin/woman
parentd9f33332f52a60130325a5d16785ee9577647d42 (diff)
scripts: Move many scripts from sh to andy
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
}