aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorJohn <john@ankarstrom.se>2019-06-08 00:41:37 +0200
committerJohn <john@ankarstrom.se>2019-06-08 00:46:01 +0200
commit2d9446bbe431fb173e812472f438e0751fbb87b1 (patch)
tree77e49390393400f76bf1c6a2ed7da6d4570a0050
parent4572e5875ff4a2385199994abaad0d3a30727541 (diff)
downloaddwim-2d9446bbe431fb173e812472f438e0751fbb87b1.tar.gz
change names of handlers
-rwxr-xr-xdwim10
1 files changed, 5 insertions, 5 deletions
diff --git a/dwim b/dwim
index f93fa0c..455d778 100755
--- a/dwim
+++ b/dwim
@@ -33,19 +33,19 @@ for ($phrase) {
}
if (/^(.+):(\d+).*?$/) {
- handle "{file}:{line} (like grep -n)";
+ handle "file:line (like grep -n)";
my $p = path $1;
run @LAUNCHER, @EDITOR, "-c", ":$2", "$p"
}
if (/^(.+) line (\d+)\.?$/) {
- handle "{file} line {line} (like perl)";
+ handle "FILE line LINE (like perl)";
my $p = path $1;
run @LAUNCHER, @EDITOR, "-c", ":$2", "$p"
}
if (/^(.+):(.+)$/) {
- handle "{file}:{query} (like grep)";
+ handle "file:query (like grep)";
my $p = path $1;
run @LAUNCHER, @EDITOR, "-c", "/$2", "$p" if -e $p;
fail "file not found" if $o{d};
@@ -53,12 +53,12 @@ for ($phrase) {
}
if (/^([^\s]+)\(([^\s]+)\)[,.]?/) {
- handle "{manpage}({section})";
+ handle "manpage(section)";
run @LAUNCHER, "man", "$2", "$1";
}
if (/^<([^\s]+)>$/) {
- handle "header file";
+ handle "<header.h>";
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";