Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP

Loading…

Fix -- switch #129

Closed
wants to merge 1 commit into from

1 participant

@notwa

before, this loop would run with no parameters remaining and shift would complain. now, it looks ahead one parameter so there's always one to shift.

@notwa

bah I jumped to conclusions. this commit then struggles with z -- -h. I might put another one up.

@notwa notwa closed this
@notwa notwa referenced this pull request
Merged

Prevent extraneous shifting #130

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Commits on Mar 31, 2014
  1. @notwa

    Fix -- switch

    notwa authored
This page is out of date. Refresh to see the latest.
Showing with 1 addition and 1 deletion.
  1. +1 −1  z.sh
View
2  z.sh
@@ -103,7 +103,7 @@ _z() {
else
# list/go
while [ "$1" ]; do case "$1" in
- --) while [ "$1" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
+ --) while [ "$2" ]; do shift; local fnd="$fnd${fnd:+ }$1";done;;
-*) local opt=${1:1}; while [ "$opt" ]; do case ${opt:0:1} in
c) local fnd="^$PWD $fnd";;
h) echo "${_Z_CMD:-z} [-chlrtx] args" >&2; return;;
Something went wrong with that request. Please try again.