Skip to content

Commit 86c1a28

Browse files
committed
Merge branch 'issue-73'
2 parents 81e2fd6 + a5b2a39 commit 86c1a28

File tree

1 file changed

+10
-6
lines changed

1 file changed

+10
-6
lines changed

rmate

+10-6
Original file line numberDiff line numberDiff line change
@@ -168,10 +168,10 @@ function canonicalize {
168168
echo "$result"
169169
}
170170

171-
while [[ "${1:0:1}" = "-" || "$1" =~ ^\+([0-9]+)$ ]]; do
171+
while [[ "$1" != "" ]]; do
172172
case $1 in
173173
-)
174-
break
174+
filepaths+=("-")
175175
;;
176176
--)
177177
shift
@@ -220,12 +220,16 @@ while [[ "${1:0:1}" = "-" || "$1" =~ ^\+([0-9]+)$ ]]; do
220220
showusage
221221
exit 0
222222
;;
223-
+[0-9]*)
223+
+[0-9][0-9]*)
224224
selections+=(${1:1})
225225
;;
226226
*)
227-
showusage
228-
exit 1
227+
if [[ "${1:0:1}" = "-" ]]; then
228+
showusage
229+
exit 1
230+
else
231+
filepaths+=("$1")
232+
fi
229233
;;
230234
esac
231235

@@ -236,7 +240,7 @@ if [[ "$host" = "auto" && "$SSH_CONNECTION" != "" ]]; then
236240
host=${SSH_CONNECTION%% *}
237241
fi
238242

239-
filepaths=("$@")
243+
filepaths=("${filepaths[@]}" "$@")
240244

241245
if [ "${filepaths[*]}" = "" ]; then
242246
if [[ $nowait = false ]]; then

0 commit comments

Comments
 (0)