Esempio n. 1
0
func main() {
	alg := cli.AlgorithmFlag(availableAlgs, "eratosphen_sieve")
	args := cli.IntsArgs()

	f := availableAlgs[alg]

	fmt.Println("Algorithm:", alg)
	f(args)
}
Esempio n. 2
0
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)
}