cli: allow variant binaries to set AppName #11
Labels
No labels
needs-review
needs-review
needs-review
needs-review
needs-review
needs-review
needs-review
athena
athena-gemini
audit
clotho
clotho-gemini
codex
darbs-claude
security
wiki
No milestone
No project
No assignees
1 participant
Notifications
Due date
No due date set.
Dependencies
No dependencies set.
Reference: core/go#11
Loading…
Add table
Reference in a new issue
No description provided.
Delete branch "%!s()"
Deleting a branch is permanent. Although the deleted branch may continue to exist for a short time before it actually gets removed, it CANNOT be undone in most cases. Continue?
Problem
pkg/cli/app.gohardcodesAppName = "core". When domain repos like LEM build standalone binaries usingcli.Main(), the help text showscoreinstead of the binary's actual name:Proposal
Add a
cli.WithAppName(name string)option that can be passed tocli.Main():Alternative: auto-detect from
filepath.Base(os.Args[0])as a fallback when no explicit name is set.Context
Discovered while migrating LEM (first external consumer of
pkg/cli) from manualswitch os.Args[1]to theWithCommandspattern.Acceptance
cli.Main()accepts an app name optioncorebinary behaviour unchanged (defaults to "core")Completed by Charon in
core/cli(e360115). CLI package now lives atforge.lthn.ai/core/cli/pkg/cli, notcore/go/pkg/cli.