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) } }
func main() { name := " You" if len(os.Args) > 1 { name = os.Args[1] switch option { case "-m": h.PrintMulti(message) case "-c": h.PrintColor(message) case "-f": h.PrintForever(message) default: h.PrintPlain(message) } }
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) } }