Skip to content

fix(cli): reject required positionals after optional ones - #415

Merged
codeforester merged 1 commit into
mainfrom
bug/407-20260904-lib-cli-sh-optional-positional-declared-before-a-required-on
Sep 3, 2026
Merged

fix(cli): reject required positionals after optional ones#415
codeforester merged 1 commit into
mainfrom
bug/407-20260904-lib-cli-sh-optional-positional-declared-before-a-required-on

Conversation

@codeforester

Copy link
Copy Markdown
Collaborator

Summary

Reject declaration orders that put a required positional after an optional or defaulted positional, preventing misleading runtime missing-argument failures.

Issue

Fixes #407

Validation

  • bats lib/bash/cli/tests/lib_cli.bats (28/28)
  • env -u BASE_HOME BASE_CACHE_DIR=/private/tmp/base-bash-libs-407 ./tests/validate.sh (616/616 plus all repository contracts)

Compatibility and security

Valid required-first and optional-tail declarations remain unchanged; the guard runs before model mutation.

@codeforester
codeforester merged commit 7ee4d7a into main Sep 3, 2026
11 checks passed
@codeforester
codeforester deleted the bug/407-20260904-lib-cli-sh-optional-positional-declared-before-a-required-on branch September 3, 2026 20:46
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.

lib_cli.sh: optional positional declared before a required one silently mis-assigns values

1 participant