From abb286ba2ac8364fc92d1af3e107c6e5c276e67c Mon Sep 17 00:00:00 2001 From: rowan Date: Fri, 7 Mar 2025 12:25:56 -0600 Subject: [PATCH] better error handling (again) --- README.md | 7 ++++++- configctl | 5 +++++ 2 files changed, 11 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 1c486fb..687db51 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,12 @@ i have an unhealthy relationship with overlayfs. i also like to easily change my # Usage ```sh -configctl [OPTIONS] [unmount] +configctl [OPTIONS] [unmount] + +options + -a, --automount automatically enable the changeset service file + -f, --force ovewrite existing service file + -s, --service-path the path to write the service file ``` by default, the configctl expects the base configuration set to exist in `$XDG_DATA_HOME/config/base` (usually `~/.local/share/config/base`) and the changesets to exist in `$XDG_DATA_HOME/config/changeset`. changes while the configuration is mounted will be written to `$XDG_STATE_HOME/config/{,.work_}` diff --git a/configctl b/configctl index b7a5387..e59400d 100755 --- a/configctl +++ b/configctl @@ -60,6 +60,11 @@ CHANGESET="$CHANGESET_DIR/$SELECTED" UPPER_DIR="$XDG_STATE_HOME/config/$SELECTED" WORKDIR="$XDG_STATE_HOME/config/.work_$SELECTED" +if [ -z "$SELECTED" ]; then + usage + exit +fi + if [ ! -d "$CHANGESET" ]; then echo "'$CHANGESET' not found." exit 1