Skip to content

Fix misleading usage message and silent dir creation for bad config path#343

Merged
jappeace merged 1 commit into
snoyberg:masterfrom
jezen:fix/issue-199-misleading-usage
Jul 13, 2026
Merged

Fix misleading usage message and silent dir creation for bad config path#343
jappeace merged 1 commit into
snoyberg:masterfrom
jezen:fix/issue-199-misleading-usage

Conversation

@jezen

@jezen jezen commented Jun 11, 2026

Copy link
Copy Markdown
Collaborator

Fixes #199.

Running keter <path> with a path intended as a config file that doesn't exist silently treated that path as the keter home directory and populated a subdirectory tree inside it — leaving users hunting for their logs and config. The usage message added to the confusion by calling the argument <config file> when keter expects the home directory (or a config file).

This distinguishes three cases explicitly in runKeterConfigReader: an existing file is decoded as config, an existing directory is used as kconfigDir, and a path that is neither now throws a new ConfigPathDoesNotExist exception instead of being silently adopted. The usage string is updated to describe both accepted forms.

Bumps to 2.4.1 with a changelog entry.

Keter treated a nonexistent config path as the home directory and
silently populated a tree there. It now errors on a path that is
neither an existing file nor directory, and the usage message
describes both accepted forms.

Closes snoyberg#199
@jezen jezen marked this pull request as ready for review June 11, 2026 10:29
@jappeace jappeace merged commit d406bbe into snoyberg:master Jul 13, 2026
9 checks passed
@jezen jezen deleted the fix/issue-199-misleading-usage branch July 13, 2026 08:48
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

keter without arguments prints misleading error message

2 participants