Skip to content
Open
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 4 additions & 1 deletion ishell.go
Original file line number Diff line number Diff line change
Expand Up @@ -268,10 +268,13 @@ func (s *Shell) handleCommand(str []string) (bool, error) {
}
cmd, args := s.rootCmd.FindCmd(str)
if cmd == nil {
if args[0] == "?" {
s.Println(s.HelpText())
}
return false, nil
}
// trigger help if func is not registered or auto help is true
if cmd.Func == nil || (s.autoHelp && len(args) == 1 && args[0] == "help") {
if cmd.Func == nil || (s.autoHelp && len(args) == 1 && (args[0] == "help" || args[0] == "?")) {
s.Println(cmd.HelpText())
return true, nil
}
Expand Down