func Main() { ShowMenu() for { key := mcore.ReadNotBlankLineWithMsg(mmsg.LocaleMessage("msg-input-which-run")) if mcore.String(key).TrimSpace().IsIn("q", "quit", "exit") { return } if mcore.String(key).TrimSpace().IsIn("m", "menu") { ShowMenu() continue } if mcore.String(key).TrimSpace().IsIn("m", "all") { RunAll() continue } if mcore.String(key).TrimSpace().IsIn("h", "help") { ShowHelp() continue } RunKey(key) RunFuncWithKey(key) RunMethod(key) } }
func main() { DoFlag() if help { fmt.Println("Help about command") usage() return } // should tell me what to search if flag.NArg() > 0 { searchContent = strings.Join(flag.Args(), " ") } // check searchContent if searchContent == "" { searchContent = mcore.ReadNotBlankLineWithMsg("Input Search Content:") } ShowArgs() Search(dir, exts, recursive, skipDirs, skipFiles, searchContent) }
func ScanSearchContent() { searchStr = mcore.ReadNotBlankLineWithMsg("Input Search Content:") }