Skip to content

Commit

Permalink
Add --interactive and --non-interactive
Browse files Browse the repository at this point in the history
  • Loading branch information
9ary committed Jun 10, 2014
1 parent 8ff5dbe commit b3b03c1
Showing 1 changed file with 15 additions and 5 deletions.
20 changes: 15 additions & 5 deletions mediacrush
Original file line number Diff line number Diff line change
Expand Up @@ -35,7 +35,7 @@ if [[ $# -eq 0 ]]; then
exit 1
fi

GETOPT=`getopt -o hars: --longoptions help,version,album,dry-run,open,recursive,server: -- "$@"`
GETOPT=`getopt -o hars: --longoptions help,version,album,dry-run,open,recursive,interactive,non-interactive,server: -- "$@"`
if [[ $? != 0 ]]; then
exit 1
fi
Expand Down Expand Up @@ -72,6 +72,14 @@ while true; do
server="$2"
shift 2
;;
--interactive)
interactive=true
shift 1
;;
--non-interactive)
interactive=false
shift 1
;;
--)
shift
break
Expand Down Expand Up @@ -155,10 +163,12 @@ upload_url() {
}

upload() {
if [ -t 1 ]; then
interactive=true
else
interactive=false
if [ -z $interactive ]; then
if [ -t 1 ]; then
interactive=true
else
interactive=false
fi
fi

for f in "$@"; do
Expand Down

0 comments on commit b3b03c1

Please sign in to comment.