Skip to content

Commit 950adb0

Browse files
committed
Make desk run work with an argument vector.
1 parent 25d6349 commit 950adb0

File tree

1 file changed

+10
-3
lines changed

1 file changed

+10
-3
lines changed

desk

+10-3
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,11 @@ Usage:
3030
Activate a desk. Extra arguments are passed onto shell. If called with
3131
no arguments, look for a Deskfile in the current directory. If not a
3232
recognized desk, try as a path to directory containing a Deskfile.
33-
$PROGRAM run <desk-name> <cmd>
34-
Run a command within a desk's environment then exit. Think '\$SHELL -c'.
33+
$PROGRAM run <desk-name> '<cmd>'
34+
$PROGRAM run <desk-name> <cmd> <arg>...
35+
Run a command within a desk's environment then exit. In the first form
36+
shell expansion is performed. In the second form, the argument vector
37+
is executed as is.
3538
$PROGRAM edit [desk-name]
3639
Edit (or create) a deskfile with the name specified, otherwise
3740
edit the active deskfile.
@@ -138,7 +141,11 @@ cmd_go() {
138141
cmd_run() {
139142
local TODESK="$1"
140143
shift;
141-
cmd_go "$TODESK" -ic "$@"
144+
if [ $# -eq 1 ]; then
145+
cmd_go "$TODESK" -ic "$1"
146+
else
147+
cmd_go "$TODESK" -ic '"$@"' -- "$@"
148+
fi
142149
}
143150

144151

0 commit comments

Comments
 (0)