Skip to content

cli: Add contextual help with Kong - #2

Merged
abhinav merged 1 commit into
bracesdev:mainfrom
abhinav:kong
Nov 17, 2026
Merged

abhinav merged 1 commit into
bracesdev:mainfrom
abhinav:kong

Conversation

@abhinav

@abhinav abhinav commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator

Layerctl had no top-level --help, and it opened the definition
repository before parsing subcommand flags.
Adding help at every command level exposed how much syntax lived
in manual dispatch and argument handling.
Go's flag package stops at the first positional argument, so
projection create NAME --worktree PATH had to consume NAME
by hand before parsing the flags.

Declare the command tree in Kong so the same definitions drive
argument parsing, contextual help, and dispatch to typed commands.
Command flags can appear before or after positional arguments.
Handle help, version queries, and invalid arguments before opening
the repository.

@abhinav

abhinav commented Nov 17, 2026

Copy link
Copy Markdown
Collaborator Author

This change is part of the following stack:

Change managed by git-spice.

Layerctl had no top-level `--help`, and it opened the definition
repository before parsing subcommand flags.
Adding help at every command level exposed how much syntax lived
in manual dispatch and argument handling.
Go's `flag` package stops at the first positional argument, so
`projection create NAME --worktree PATH` had to consume `NAME`
by hand before parsing the flags.

Declare the command tree in Kong so the same definitions drive
argument parsing, contextual help, and dispatch to typed commands.
Command flags can appear before or after positional arguments.
Handle help, version queries, and invalid arguments before opening
the repository.
@abhinav
abhinav merged commit ae1ea7e into bracesdev:main Nov 17, 2026
1 check passed
@abhinav
abhinav deleted the kong branch November 18, 2026 04:44
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.

1 participant