Пример #1
0
func main() {
	name, option := h.ParseArgs()
	message := name + "!"

	if option == "-m" {
		h.PrintMulti(message)
	} else if option == "-r" {
		h.PrintRandom(message)
	} else if option == "-f" {
		h.PrintForevah(message)
	} else {
		h.PrintPlain(message)
	}
}
Пример #2
0
func main() {
	name, option := m.ParseArgs()
	message := "Hello " + name + "!"
	switch option {
	case "-f":
		m.PrintForever(message)
	case "-c":
		m.PrintRandom(message)
	case "-m":
		m.PrintMulti(message)
	case "-i":
		m.FillScreen(message)
	default:
		m.PrintNormal(message)
	}
}