func main() { alg := cli.AlgorithmFlag(availableAlgs, "eratosphen_sieve") args := cli.IntsArgs() f := availableAlgs[alg] fmt.Println("Algorithm:", alg) f(args) }
func main() { alg := cli.AlgorithmFlag(availableAlgs, "merge") cli.RequireSortingArgs() list := cli.IntsArgs() f := availableAlgs[alg] f(list) fmt.Println("Algorithm:", alg) fmt.Println("Sorted list:", list) }