Skip to content

Commit

Permalink
fix: binWithCmd is not full path
Browse files Browse the repository at this point in the history
  • Loading branch information
inhere committed Jan 6, 2022
1 parent 8ab89c3 commit ee4068c
Showing 1 changed file with 6 additions and 2 deletions.
8 changes: 6 additions & 2 deletions cmd.go
Original file line number Diff line number Diff line change
Expand Up @@ -309,11 +309,15 @@ func (c *Command) initCore(cName string) {
c.core.Hooks = &Hooks{}
}

binWithPath := c.binName + " " + c.Path()

c.AddVars(c.innerHelpVars())
c.AddVars(map[string]string{
"cmd": cName,
// binName with command
"binWithCmd": c.binName + " " + cName,
// binName with command name
"binWithCmd": binWithPath,
// binName with command path
"binWithPath": binWithPath,
// binFile with command
"fullCmd": c.binFile + " " + cName,
})
Expand Down

0 comments on commit ee4068c

Please sign in to comment.