diff options
-rwxr-xr-x | install.sh | 29 |
1 files changed, 18 insertions, 11 deletions
@@ -11,18 +11,25 @@ scripts shortcmds sp" -case "$1" in - "-s"|"-S"|"-y"|"-Y") - ___USE_SSH=y - ;; - "-h") - printf "install.sh\n\nUsed to add my other script repos as submodules. Feel free to modfy it to clone yours as well.\n" - printf "-s, -S, -y, and -Y will clone using SSH. -h will show this help menu. Everything else will clone using https.\n" - ;; - *) - unset ___USE_SSH +printhelp () { + printf "install.sh | Used to add my other script repos as submodules. Feel free to modfy it to clone yours as well.\n" + printf " -s) clone repos using ssh\n" + printf " -S) clone repos using https\n" + printf " -h) prints this help message\n" + printf " -u X ) will clone using X as the URL\n" +} + +while getopts "cdhsSu:" o; do case "${o}" in + c) unset SCRIPT_DIRS ;; + d) + [ -n "$SCRIPT_DIRS" ] && SCRIPT_DIRS="$SCRIPT_DIRS\n$OPTARG" + [ -z "$SCRIPT_DIRS" ] && SCRIPT_DIRS="$OPTARG" ;; -esac + s) ___USE_SSH=y ;; + S) unset ___USE_SSH ;; + u) URL="$OPTARG" ;; + *) printhelp ;; +esac done clone_dir () { if [ -d "$1" ]; then |