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"