4 echo "usage: btadd [-d DIR] URL..." >&2
10 while [ "$#" -gt 0 ]; do
13 if [ "$arg" = -d ]; then
16 elif [ "$arg" = -o ]; then
17 dir="$HOME/bt/$(date "+%y%m%d-%H%M%S")"
20 tfile="$(mktemp /tmp/torrentXXXXXX)"
21 if [ "$arg" = - ]; then
24 if ! wget -qO "$tfile" "$arg"; then
25 echo "btadd: could not fetch $arg" >&2
31 if ! btcli add -d "$dir" "$tfile"; then