Skip to content

Commit

Permalink
Merge pull request #26 from reeflective/dev
Browse files Browse the repository at this point in the history
dev
  • Loading branch information
maxlandon authored Aug 10, 2023
2 parents bb6bbfd + fbe6474 commit 014f258
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 15 deletions.
3 changes: 1 addition & 2 deletions menu.go
Original file line number Diff line number Diff line change
Expand Up @@ -322,8 +322,7 @@ func (m *Menu) errorFilteredCommandTemplate(filters []string) string {
}

return `Command {{.cmd.Name}} is only available for: {{range .filters }}
- {{.}}
{{end}}`
- {{.}} {{end}}`
}

// tmpl executes the given template text on data, writing the result to w.
Expand Down
14 changes: 1 addition & 13 deletions run.go
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,7 @@ func (c *Console) ExecuteOnce() error {
// which may modify the input line args.
args, err := c.runLineHooks(os.Args)
if err != nil {
return fmt.Errorf("line error: %s\n", err.Error())
return fmt.Errorf("line error: %s", err.Error())
}

// Run all pre-run hooks and the command itself
Expand Down Expand Up @@ -231,18 +231,6 @@ func (c *Console) executeCommand(cmd *cobra.Command, cancel context.CancelCauseF
cancel(nil)
}

// Generally, an empty command entered should just print a new prompt,
// unlike for classic CLI usage when the program will print its usage string.
// We simply remove any RunE from the root command, so that nothing is
// printed/executed by default. Pre/Post runs are still used if any.
func (c *Console) ensureNoRootRunner() {
if c.activeMenu().Command != nil {
c.activeMenu().RunE = func(cmd *cobra.Command, args []string) error {
return nil
}
}
}

func (c *Console) loadActiveHistories() {
c.shell.History.Delete()

Expand Down

0 comments on commit 014f258

Please sign in to comment.