From 4ea59a778d231df45b0ad79634531ed3013704cb Mon Sep 17 00:00:00 2001 From: Fernando Schauenburg Date: Sat, 7 Aug 2021 01:33:55 +0200 Subject: [PATCH] bootstrap: better handling of dry run --- bootstrap | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/bootstrap b/bootstrap index 24154db..73f039c 100755 --- a/bootstrap +++ b/bootstrap @@ -1,7 +1,22 @@ #!/bin/sh set -eu -DRY_RUN=false +usage() { + echo "Usage: $(basename $0) [-h] [-f]" + echo "" + echo " -h print this help and exit" + echo " -f modify filesystem rather than dry run" +} + +DRY_RUN=true +while getopts 'fh' opt; do + case "$opt" in + f) DRY_RUN=false;; + h) usage; exit 0;; + *) usage; exit 1;; + esac +done + DEFAULT_GIT_USER="Fernando Schauenburg" DEFAULT_GIT_EMAIL="fernando@schauenburg.me"