Age | Commit message (Collapse) | Author |
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
Technically, spaces are permitted in e-mail addresses if quoted, but
this is very uncommon.
|
|
|
|
|
|
|
|
`run` is basically an alias for `exec`, except it prints the command
being executed to STDERR when the -d option is specified.
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
|
To facilitate debugging, I've reified the handler descriptions, which
were comments previously. Now, they've been made strings passed to
the `handle` subroutine, which sets `$handler`, which then (in case of
-d) can be read by `fail`, which notifies the user that a handler has
failed.
|
|
|
|
|
|
This is the Perl version of dwim. It is much easier to work with and
extend, thanks to Perl's excellent regex support.
The "phrase" (either $ARGV[0] or the primary X selection) is matched
against regular expressions in the for loop (a primitive switch
statement). This is the place to add handlers.
Options are specified through environment variables, defined with
default values in the section before the handlers.
The `path` subroutine transforms a relative path to an absolute path
based on the title of the current window. It depends on the `xtitle`
program, and for it to work, you must instruct your shell (or editor) to
set the terminal's title to the current directory (or currently edited
file).
(As such, `path` doesn't work with other programs than terminals and
editors.)
|
|
This is the first version of my dwim script. The problem with POSIX
sh is that the case matching syntax isn't powerful enough. I need
something like Perl's regex matching capabilities.
|