Skip to content

Commit

Permalink
Fix handling of dash as file name
Browse files Browse the repository at this point in the history
  • Loading branch information
zwets committed Nov 29, 2016
1 parent 5ea1c90 commit 328222b
Show file tree
Hide file tree
Showing 7 changed files with 12 additions and 9 deletions.
2 changes: 1 addition & 1 deletion uf-bare
Original file line number Diff line number Diff line change
Expand Up @@ -46,7 +46,7 @@ Usage: $(basename $0) [OPTIONS] [FILE] ...

unset HDRSFILE FORCE

while [ $# -ne 0 -a "$(expr "$1" : '\(.\).*')" = "-" ]; do
while [ $# -ne 0 -a "$(expr "$1" : '\(.\)..*')" = "-" ]; do
case $1 in
-w) shift
[ $# -ge 1 ] || usage_exit
Expand Down
2 changes: 1 addition & 1 deletion uf-dress
Original file line number Diff line number Diff line change
Expand Up @@ -52,7 +52,7 @@ Usage: $(basename $0) [OPTIONS] [FILE] ...

unset HDRSFILE

while [ $# -ne 0 -a "$(expr "$1" : '\(.\).*')" = "-" ]; do
while [ $# -ne 0 -a "$(expr "$1" : '\(.\)..*')" = "-" ]; do
case $1 in
-r) shift
[ $# -ge 1 ] || usage_exit
Expand Down
2 changes: 1 addition & 1 deletion uf-freqs
Original file line number Diff line number Diff line change
Expand Up @@ -47,7 +47,7 @@ BARE=0
LENGTH_ONLY=0
TOTALS=0

while [ $# -ne 0 -a "$(expr "$1" : '\(.[0-9]*\).*')" = "-" ]; do
while [ $# -ne 0 -a "$(expr "$1" : '\(.[0-9]*\)..*')" = "-" ]; do
case $1 in
-b|--bare)
BARE=1
Expand Down
2 changes: 1 addition & 1 deletion uf-headers
Original file line number Diff line number Diff line change
Expand Up @@ -37,7 +37,7 @@ Usage: $(basename $0) [OPTIONS] [FILE] ...

# Parse options

while [ $# -ne 0 -a "$(expr "$1" : '\(.\).*')" = "-" ]; do
while [ $# -ne 0 -a "$(expr "$1" : '\(.\)..*')" = "-" ]; do
case $1 in
--help)
usage_exit 0
Expand Down
4 changes: 2 additions & 2 deletions uf-rc
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,7 @@ err_exit() {
# Function to show usage information and exit
usage_exit() {
echo "
Usage: $(basename $0) [OPTIONS] [FILE] ...
Usage: $(basename $0) [OPTIONS] [FILE ...]
Write to standard output the reverse complement of every sequence in each FILE.
If no FILE is present or FILE is '-', read from standard input.
Expand All @@ -62,7 +62,7 @@ MARK=0

# Parse options

while [ $# -ne 0 -a "$(expr "$1" : '\(.\).*')" = "-" ]; do
while [ $# -ne 0 -a "$(expr "$1" : '\(.\)..*')" = "-" ]; do
case $1 in
-r|--reverse-only)
COMPLEMENT=0
Expand Down
5 changes: 4 additions & 1 deletion uf-select
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ err_exit() {
# Function to show usage information and exit
usage_exit() {
echo "
Usage: $(basename $0) [OPTIONS|NUMBERS|REGEX] [FILE] ...
Usage: $(basename $0) [OPTIONS|NUMBERS|REGEX] [FILE ...]
Select sequences from unfasta FILEs and write to standard output. If no FILE
is present or when FILE is '-', read standard input.
Expand Down Expand Up @@ -66,6 +66,9 @@ while [ $# -ne 0 -a "$(expr "$1" : '\(.[0-9]*\).*')" = "-" ]; do
-h|--help)
usage_exit 0
;;
-)
break
;;
*) usage_exit
;;
esac
Expand Down
4 changes: 2 additions & 2 deletions uf-valid
Original file line number Diff line number Diff line change
Expand Up @@ -58,7 +58,7 @@ err_exit() {
# Function to show usage information and exit
usage_exit() {
echo "
Usage: $(basename $0) [OPTIONS] [FILE] ...
Usage: $(basename $0) [OPTIONS] [FILE ...]
Validate the sequences in each FILE against the allowed alphabet. If no FILE
is present or FILE is '-', read from standard input. Only valid sequences are
Expand Down Expand Up @@ -98,7 +98,7 @@ QUIET=0

# Parse options

while [ $# -ne 0 -a "$(expr "$1" : '\(.\).*')" = "-" ]; do
while [ $# -ne 0 -a "$(expr "$1" : '\(.\)..*')" = "-" ]; do
case $1 in
--allow=*)
ALLOW="${ALLOW}${1#"--allow="}"
Expand Down

0 comments on commit 328222b

Please sign in to comment.