Skip to content

fix: exit 1 for unknown top-level verb instead of 0 - #21

Merged
kanfil merged 1 commit into
tikalk:mainfrom
Jah-yee:fix/unknown-verb-exit-code
Sep 30, 2026
Merged

kanfil merged 1 commit into
tikalk:mainfrom
Jah-yee:fix/unknown-verb-exit-code

Conversation

@Jah-yee

@Jah-yee Jah-yee commented Sep 29, 2026

Copy link
Copy Markdown
Contributor

Fix: exit 1 for unknown top-level verb

Unknown top-level verbs (e.g. adlc-cli factory-mission) currently print help and exit 0. This is problematic because callers checking the exit code see success for a command that did nothing.

Changes

In src/dispatch.mjs, split the top-level default case from case "help": so that:

  • adlc-cli help → prints help, exits 0 (unchanged)
  • adlc-cli <unknown-verb> → prints help, exits 1 (fixed)

This is consistent with how sub-commands (skills, team, workspace, workflow) already handle unknown subcommands: print help + exit 1.

References

Unknown verbs (e.g. 'adlc-cli factory-mission') currently print
help and exit 0. Callers checking the exit code see success for
a command that did nothing.

Fix: return 1 in the top-level default case, consistent with
how sub-commands (skills/team/workspace/workflow) handle unknown
subcommands (print error + help, return 1).
@Jah-yee

Jah-yee commented Sep 29, 2026

Copy link
Copy Markdown
Contributor Author

叉一下~ This makes the exit code consistent with how sub-commands handle unknown arguments (exit 1). Happy to address any feedback!

@kanfil kanfil self-assigned this Sep 30, 2026
@kanfil
kanfil merged commit 3cb66fc into tikalk:main Sep 30, 2026
9 checks passed
@kanfil kanfil mentioned this pull request Sep 30, 2026
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.

Unknown verb exits 0 — silent no-op reports success

2 participants