Expose canonical paths on command invocations

This commit is contained in:
2026-10-19 19:33:49 +00:00
parent 75fc45f072
commit 451a0c483f
5 changed files with 128 additions and 3 deletions

View File

@@ -34,4 +34,15 @@ type Invocation struct {
Context context.Context
// Streams are the caller-selected output destinations.
Streams Streams
enteredPath string
canonicalPath string
}
// EnteredPath returns the command path used to invoke the selected command.
// It is empty for an Invocation that was not created by command execution.
func (inv Invocation) EnteredPath() string { return inv.enteredPath }
// CanonicalPath returns the selected command's canonical path.
// It is empty for an Invocation that was not created by command execution.
func (inv Invocation) CanonicalPath() string { return inv.canonicalPath }