Exemplo n.º 1
0
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)
	}
}
Exemplo n.º 2
0
Arquivo: main.go Projeto: mabetle/mcmd
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)
}
Exemplo n.º 3
0
Arquivo: main.go Projeto: mabetle/mcmd
func ScanSearchContent() {
	searchStr = mcore.ReadNotBlankLineWithMsg("Input Search Content:")
}