summaryrefslogtreecommitdiff
path: root/urititle
diff options
context:
space:
mode:
authorepoch <epoch@thebackupbox.net>2022-09-05 08:07:50 +0000
committerepoch <epoch@thebackupbox.net>2022-09-05 08:07:50 +0000
commitd085cb196811bf3529b403089bf509de17980a57 (patch)
tree29d6674e83afc47e36d8267ab3c9d5802862c469 /urititle
parentafedc7a0fb30d6c4e5d01793b2a0d25f6d562666 (diff)
downloaduritools-d085cb196811bf3529b403089bf509de17980a57.tar.gz
uritools-d085cb196811bf3529b403089bf509de17980a57.zip
shitty implementation of titles for man pages
Diffstat (limited to 'urititle')
-rwxr-xr-xurititle9
1 files changed, 9 insertions, 0 deletions
diff --git a/urititle b/urititle
index 2a02e0f..bf72f39 100755
--- a/urititle
+++ b/urititle
@@ -162,6 +162,15 @@ file)
printf "file '%s' doesn't exist.\n" "$file"
fi
;;
+man)
+ section="$(uriunescape "$path" | grep '(' | cut -d\( -f2 | tr -cd 'a-z0-9')"
+ command="$(uriunescape "$path" | cut -d\( -f1 )"
+ if [ "$section" ];then
+ apropos -s "$section" -we "${command}" | grep "^${command}"
+ else
+ apropos -we "${command}" | grep "^${command}"
+ fi
+ ;;
*)
printf "DONT KNOW HOW TO GET TITLE FOR THIS URL: %s\n" "$uri"
esac