Skip to content

Commit

Permalink
completion-path.sh: handle empty args more gracefully
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Aug 17, 2017
1 parent b413657 commit efb7091
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions docs/examples/completion-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -13,11 +13,11 @@ set_target_path() {
target_base=$(command cd $(dirname "$base_path")/.. >/dev/null && pwd)"/done"
month=$(date +'%Y-%m')

test -n "$target" || case $(tr A-Z' ' a-z_ <<<"$label") in
test -n "$target" || case $(tr A-Z' ' a-z_ <<<"${label:-NOT_SET}") in
tv) target="tv" ;;
movie*) target="movies/$month" ;;
esac
test -n "$target" || case $(tr A-Z' ' a-z. <<<"$name") in
test -n "$target" || case $(tr A-Z' ' a-z. <<<"${name:-EMPTY}") in
*hdtv*) target="tv" ;;
*rip.x264*) target="movies/$month" ;;
*pdf|*epub|*ebook*) target="ebooks/$month" ;;
Expand Down

0 comments on commit efb7091

Please sign in to comment.