aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn <john@ankarstrom.se>2019-06-08 00:38:31 +0200
committerJohn <john@ankarstrom.se>2019-06-08 00:44:37 +0200
commit4572e5875ff4a2385199994abaad0d3a30727541 (patch)
tree338be2fa358fb0561561af377b9e9583541c33b4
parentc53a3eed701ed7b347a40b4ac6bd45660fc19d6e (diff)
downloaddwim-4572e5875ff4a2385199994abaad0d3a30727541.tar.gz
add handler for <header.h> notation
-rwxr-xr-xdwim7
1 files changed, 7 insertions, 0 deletions
diff --git a/dwim b/dwim
index b646de6..f93fa0c 100755
--- a/dwim
+++ b/dwim
@@ -57,6 +57,13 @@ for ($phrase) {
run @LAUNCHER, "man", "$2", "$1";
}
+ if (/^<([^\s]+)>$/) {
+ handle "header file";
+ run @LAUNCHER, @EDITOR, "/usr/include/$1" if -e "/usr/include/$1";
+ run @LAUNCHER, @EDITOR, "/usr/local/include/$1" if -e "/usr/local/include/$1";
+ fail "header file not found";
+ }
+
if (/^([^\s]+)$/) {
handle "maildir / directory / file";
my $p = path $1;