From 6409d6d1468d195be9aa4849bb79a46704ca046f Mon Sep 17 00:00:00 2001 From: rowan Date: Fri, 7 Mar 2025 12:22:04 -0600 Subject: [PATCH] error handling, readme updates --- README.md | 2 +- configctl | 3 +++ 2 files changed, 4 insertions(+), 1 deletion(-) diff --git a/README.md b/README.md index 9eb1f09..1c486fb 100644 --- a/README.md +++ b/README.md @@ -11,7 +11,7 @@ i have an unhealthy relationship with overlayfs. i also like to easily change my # Usage ```sh -configctl [unmount] +configctl [OPTIONS] [unmount] ``` 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 fbdc891..b7a5387 100755 --- a/configctl +++ b/configctl @@ -48,10 +48,13 @@ while true; do -s | --service-path ) SVC_PATH="$2"; shift 2 ;; \? | -\? ) echo "Unknown option: $1"; exit 1 ;; -- ) shift; break ;; + -* ) echo "ERROR: Unknown option: '$1'"; exit 1 ;; * ) break ;; esac done +shift "$(($OPTIND - 1))" + SELECTED="$1" CHANGESET="$CHANGESET_DIR/$SELECTED" UPPER_DIR="$XDG_STATE_HOME/config/$SELECTED"