Expose canonical paths on command invocations
This commit is contained in:
11
identity.go
11
identity.go
@@ -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 }
|
||||
|
||||
Reference in New Issue
Block a user