diff --git a/mkshare b/mkshare index dc1d807..7fb243c 100755 --- a/mkshare +++ b/mkshare @@ -2,9 +2,8 @@ set -e -BASE="$0" -SHARE_DIR="" -SOURCE_DIR="" +output_dir="" +source_dir="" compress="false" expire="false" @@ -29,17 +28,10 @@ common options: [ $# -eq 0 ] && print_usage && exit 1 # parse flags -# c: compress -# use zip to compress files or directories and put link to created zip file -# e: expire -# use ISO-8061 datetime string to set expiry date -# default expiry date is 7 days from creation -# h: help -# print usage -# s: shorten +# s: shorten (optional) # generate random string of characters using `head /dev/urandom | tr -dc A-Za-z0-9 | head -c16` -while getopts ':cehs' flag; do +while getopts 'cehso:d' flag; do case "$flag" in h) print_usage ;; c) @@ -62,6 +54,14 @@ while getopts ':cehs' flag; do s) shorten="true" ;; + o) + # NEEDS REALPATH VERIFICATION + output_dir="${OPTARG}" + ;; + d) + # NEEDS REALPATH VERIFICATION + source_dir="${OPTARG}" + ;; ?) echo "Invalid option: -${OPTARG}" echo