From 9a47682916dbb6d9c861d17da8997cf946a8a38d Mon Sep 17 00:00:00 2001 From: Carl Zhu Date: Fri, 13 Sep 2019 10:53:27 -0700 Subject: [PATCH] Update ishell.go make question mark "?" has the same effect as "help" --- ishell.go | 5 ++++- 1 file changed, 4 insertions(+), 1 deletion(-) diff --git a/ishell.go b/ishell.go index f440095..83e7cbc 100644 --- a/ishell.go +++ b/ishell.go @@ -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 }