diff options
author | zachir <zachir@librem.one> | 2023-02-28 22:04:32 -0600 |
---|---|---|
committer | zachir <zachir@librem.one> | 2023-02-28 22:04:32 -0600 |
commit | 31a70a696cbe893a82ec71534fec1126c458517c (patch) | |
tree | 214b4d9ddd1a4e5ec0397efe8065f6e9b62141fa /install.sh | |
parent | 187a18feb73ac9a1513a6100a1ffdb5f29f3debe (diff) |
reorganize install.sh to be more proper
Diffstat (limited to 'install.sh')
-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 |