aboutsummaryrefslogtreecommitdiff
path: root/.local/bin/libview
diff options
context:
space:
mode:
authorNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
committerNPScript <nathan@reinerweb.ch>2022-04-09 21:22:20 +0200
commit896c311feb10e947c727a888308dbc7eb71d1ec2 (patch)
treeb6713478d14eb8ea531107c3f399c437db7fd2fb /.local/bin/libview
init commit
Diffstat (limited to '.local/bin/libview')
-rwxr-xr-x.local/bin/libview17
1 files changed, 17 insertions, 0 deletions
diff --git a/.local/bin/libview b/.local/bin/libview
new file mode 100755
index 0000000..5f96d73
--- /dev/null
+++ b/.local/bin/libview
@@ -0,0 +1,17 @@
+#!/bin/sh
+
+cd /usr/include
+
+file=$(find . -name "*.h" | sed -e 's/^.\///g' | fzf)
+
+#echo $file
+
+fname=$(grep -E '^extern .*;$' "/usr/include/$file" | awk '{ print $3 }' | fzf)
+
+page=$(whatis "$fname" | sed -E 's/([A-Za-z]*) \(([^)]*)\).*/\2 \1/g')
+
+selpage="$page"
+
+[ "$(echo "$page" | wc -l)" -ne 1 ] && selpage=$(echo "$page" | fzf)
+
+man $selpage