예제 #1
0
func Main() {
	Cls()
	data := cf.CF_getData()
	filter := ""
	if len(os.Args) > 1 {
		filter = os.Args[1]
	}
	inputCommand(Check_filterData(filter, data), data)
}
예제 #2
0
func Check_switchCommand(arrayStack []string, arrayInputKey []string, data []byte) []string {
	Cls()
	first := arrayInputKey[0]
	first = first[0:1]
	switch {
	case "q" == arrayInputKey[0]:
		os.Exit(0)
	case "?" == arrayInputKey[0]:
		print("?       help\n")
		print("q       exit\n")
		print("r       reload\n")
		print("/       search\n")
	case "r" == arrayInputKey[0]:
		data := cf.CF_getData()
		arrayStack = Check_filterData("", data)
	case "/" == arrayInputKey[0][0:1]:
		arrayStack = Check_filterData(arrayInputKey[0][1:len(arrayInputKey[0])], data)
	default:
		if n, err := strconv.Atoi(arrayInputKey[0]); err == nil {
			Check(arrayStack[n], data)
		}
	}
	return arrayStack
}