diff options
author | John <john@ankarstrom.se> | 2019-06-04 20:40:07 +0200 |
---|---|---|
committer | John <john@ankarstrom.se> | 2019-06-04 20:40:07 +0200 |
commit | 49aa32c46a6f0375581492cde45a55d7c3331a07 (patch) | |
tree | 186b4c5aacbf4a1b24a8920bd0d895e685cbde06 | |
parent | 08d83595dd729ca42ab1746bc5b7744e99eec1aa (diff) | |
download | dwim-49aa32c46a6f0375581492cde45a55d7c3331a07.tar.gz |
rename handlers
-rwxr-xr-x | dwim | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -33,20 +33,20 @@ for ($phrase) { } if (/^(.+):(\d+)(:.*?)?$/) { - handle "file:line"; - my $p = path($1); + handle "{file}:{line} (like grep -n)"; + my $p = path $1; exec @LAUNCHER, @EDITOR, "-c", ":$2", "$p" } if (/^(.+) line (\d+)\.?$/) { - handle "file \" line \" line (like perl)"; - my $p = path($1); + handle "{file} line {line} (like perl)"; + my $p = path $1; exec @LAUNCHER, @EDITOR, "-c", ":$2", "$p" } if (/^(.+):(.+)$/) { - handle "file:query (like grep)"; - my $p = path($1); + handle "{file}:{query} (like grep)"; + my $p = path $1; exec @LAUNCHER, @EDITOR, "-c", "/$2", "$p" if -e $p; fail "file not found" if $o{d}; # otherwise fall through @@ -54,7 +54,7 @@ for ($phrase) { if (/^([^\s]+)$/) { handle "maildir / directory / file"; - my $p = path($1); + my $p = path $1; exec @LAUNCHER, @MAILDIR_VIEWER, "$p" if $p =~ /^$MAILROOT/; # maildir exec @LAUNCHER, @EDITOR, "$p" if -e $p; #file fail "file not found" if $o{d}; |