Skip to content

Commit

Permalink
completion: more elaborate TV rules
Browse files Browse the repository at this point in the history
  • Loading branch information
pyroscope committed Aug 18, 2017
1 parent 76ed425 commit 35c03f5
Showing 1 changed file with 7 additions and 5 deletions.
12 changes: 7 additions & 5 deletions docs/examples/completion-path.sh
Original file line number Diff line number Diff line change
Expand Up @@ -14,13 +14,15 @@ set_target_path() {
month=$(date +'%Y-%m')

test -n "$target" || case $(tr A-Z' ' a-z_ <<<"${label:-NOT_SET}") in
tv) target="tv" ;;
movie*) target="movies/$month" ;;
tv|hdtv) target="TV" ;;
movie*) target="Movies/$month" ;;
esac
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" ;;
*hdtv*|*pdtv*) target="TV" ;;
*.s[0-9][0-9].*) target="TV" ;;
*.s[0-9][0-9]e[0-9][0-9].*) target="TV" ;;
*rip.x264*) target="Movies/$month" ;;
*pdf|*epub|*ebook*) target="eBooks/$month" ;;
esac
} # set_target_path

Expand Down

0 comments on commit 35c03f5

Please sign in to comment.