From 846a81d4006e141a7667f459b25e76d769b8d3e9 Mon Sep 17 00:00:00 2001 From: shmibs Date: Tue, 28 Mar 2017 15:56:24 -0700 Subject: use zparseopts for options --- make-gif | 202 +++++++++++++++++++++++++++------------------------------------ 1 file changed, 85 insertions(+), 117 deletions(-) (limited to 'make-gif') diff --git a/make-gif b/make-gif index 7aa845e..582a312 100755 --- a/make-gif +++ b/make-gif @@ -1,28 +1,32 @@ #!/usr/bin/env zsh # export a clip from a video as a gif -local callstr="$0" -local hasgsic=$(whence gifsicle) +local callstr=$0 +local hasgsic + +[[ $(whence gifsicle) ]] && hasgsic=true print_error() { echo -e "\e[1;31merror:\e[0m $1\n" } usage() { - [[ "$1" != "" ]] && print_error $1 + [[ -z $1 ]] || print_error $1 echo "Usage: $callstr [OPTIONS...] " + echo "Create an animated gif from a video" echo "" - echo " description option default val" - echo " start time -s