storkit: create 369_bug_cli_treats_help_and_version_as_project_paths

This commit is contained in:
dave
2026-03-23 12:41:27 +00:00
parent eb8adb6225
commit 99a59d7ad1

View File

@@ -6,25 +6,29 @@ name: "CLI treats --help and --version as project paths"
## Description
When running `storkit --help` or `storkit --version`, the binary interprets the flags as a project path argument, creates directories named `--help` and `--version`, and scaffolds a storkit project inside them.
When running `storkit <anything>`, the binary treats the first argument as a project path, creates a directory for it, and scaffolds `.storkit/` inside. This happens for `--help`, `--version`, `serve`, `x`, or any other string. There is no validation that the argument is an existing directory or a reasonable path before creating it.
## How to Reproduce
1. Run `storkit --help` in any directory
2. Observe that a directory called `--help` is created with a full `.storkit/` scaffold inside it
1. Run `storkit --help` or `storkit serve` or `storkit x` in any directory
2. Observe that a directory with that name is created with a full `.storkit/` scaffold inside it
## Actual Result
Directories named `--help` and `--version` are created and treated as project paths. No help or version info is shown.
Any argument is treated as a project path and a directory is created and scaffolded. No flags are recognised.
## Expected Result
`storkit --help` prints usage info and exits. `storkit --version` prints the version and exits. Neither should create directories or scaffold anything.
- `storkit --help` prints usage info and exits
- `storkit --version` prints the version and exits
- `storkit <path>` only works if the path already exists as a directory
- If the path does not exist, storkit prints a clear error and exits non-zero
## Acceptance Criteria
- [ ] storkit --help prints usage information and exits with code 0
- [ ] storkit --version prints the version and exits with code 0
- [ ] storkit -h and storkit -V work as short aliases
- [ ] No directories are created when help or version flags are passed
- [ ] Arguments starting with -- that are not recognised produce a clear error message
- [ ] storkit does not create directories for any argument — the path must already exist
- [ ] If the path does not exist, storkit prints a clear error and exits non-zero
- [ ] Arguments starting with - that are not recognised produce a clear error message