Skip to content

git-embedded --version / -V print help and exit 1 instead of the version #124

Open

Description

@Shinrai

src/api/cli/version.mjs registers aliases: ["-V", "--version"], but commander parses a leading -V / --version as an unknown option, not as a command alias. So git-embedded --version prints the version command's help to stdout, error: unknown option '--version' to stderr, and exits 1. git-embedded version works.

The fix is probably program.version(...) with the package version (commander handles -V, --version itself, and the commander.version code is already treated as a clean exit), or dropping the flag-style aliases. The new CLI test in tests/bin-cli.test.vitest.mjs ("looks up the command by its %s alias…") records the current exit-1 behaviour and needs updating with the fix.

Related, in the same file: asArray() in src/bin/git-embedded.mjs says slothlet passes spec arrays as Function-shaped proxies, but it returns [] for anything whose typeof isn't "object", so a function-typed proxy never reaches the index walk. Real specs arrive as plain arrays today, so nothing breaks; either the comment is stale or the check should accept functions too.

Activity

  1. added
    type: bug
    priority: low
    status: confirmed
    on Nov 8, 2026
  2. added
    status: implemented
    and removed
    status: confirmed
    on Nov 29, 2026
  3. cldmv-bot commented on Nov 29, 2026

    @cldmv-bot
    Contributor

    Marked status: implemented — resolved by #140, merged into next. This issue closes automatically when that work ships to the default branch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    priority: lowstatus: implementedtype: bug

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions