File tree Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Expand file tree Collapse file tree 1 file changed +12
-8
lines changed Original file line number Diff line number Diff line change @@ -136,7 +136,7 @@ function canonicalize {
136136 fi
137137
138138 local dir=$( dirpath " $filepath " )
139-
139+
140140 if [ -L " $filepath " ]; then
141141 relativepath=$( cd " $dir " || { echo " unable to cd to $dir " 1>&2 ; exit ; } ; readlink " $( basename " $filepath " ) " )
142142 result=$( dirpath " $relativepath " ) /$( basename " $relativepath " )
@@ -148,14 +148,14 @@ function canonicalize {
148148 result=" $dir /$result "
149149 fi
150150 fi
151-
151+
152152 echo " $result "
153153}
154154
155- while [[ " ${1 : 0 : 1} " = " - " || " $1 " =~ ^ \+ ([0-9]+)$ ]]; do
155+ while [[ " $1 " ! = " " ]]; do
156156 case $1 in
157157 -)
158- break
158+ filepaths+=( " - " )
159159 ;;
160160 --)
161161 shift
@@ -204,12 +204,16 @@ while [[ "${1:0:1}" = "-" || "$1" =~ ^\+([0-9]+)$ ]]; do
204204 showusage
205205 exit 1
206206 ;;
207- +[0-9]* )
207+ +[0-9][0-9] * )
208208 selections+=(${1: 1} )
209209 ;;
210210 * )
211- showusage
212- exit 1
211+ if [[ " ${1: 0: 1} " = " -" ]]; then
212+ showusage
213+ exit 1
214+ else
215+ filepaths+=(" $1 " )
216+ fi
213217 ;;
214218 esac
215219
@@ -220,7 +224,7 @@ if [[ "$host" = "auto" && "$SSH_CONNECTION" != "" ]]; then
220224 host=${SSH_CONNECTION%% * }
221225fi
222226
223- filepaths=(" $@ " )
227+ filepaths=(" ${filepaths[@]} " " $ @" )
224228
225229if [ " ${filepaths[*]} " = " " ]; then
226230 if [[ $nowait = false ]]; then
You can’t perform that action at this time.
0 commit comments