|
|
|
@ -27,6 +27,24 @@ const (
|
|
|
|
|
func main() {
|
|
|
|
|
// Define and parse the -r flag
|
|
|
|
|
repeat := flag.Bool("r", false, "Repeat each section separated by space, '-', '_', or a new line")
|
|
|
|
|
|
|
|
|
|
flag.Usage = func() {
|
|
|
|
|
fmt.Fprintf(os.Stderr, "Usage: %s [options]\n", os.Args[0])
|
|
|
|
|
fmt.Fprintf(os.Stderr, " %s [options] <<< \"String\"\n", os.Args[0])
|
|
|
|
|
fmt.Fprintf(os.Stderr, " %s [options] < file.txt\n", os.Args[0])
|
|
|
|
|
fmt.Fprintf(os.Stderr, " echo \"string\" | %s [options]\n", os.Args[0])
|
|
|
|
|
fmt.Fprintf(os.Stderr, "\nDescription:\n")
|
|
|
|
|
fmt.Fprintf(os.Stderr, " A basic numbers station program that will read out loud the text of a provided string, one character at a time. It will\n")
|
|
|
|
|
fmt.Fprintf(os.Stderr, " pause on line breaks, spaces, -, and _, and will repeat each section delimited by one of these characters if -r is used.\n")
|
|
|
|
|
fmt.Fprintf(os.Stderr, " It also allows for an interactive mode if nothing is provided on stdin.\n")
|
|
|
|
|
fmt.Fprintf(os.Stderr, "\nOptions:\n")
|
|
|
|
|
flag.PrintDefaults() // Print the default flag help information
|
|
|
|
|
fmt.Fprintf(os.Stderr, "\nExamples:\n")
|
|
|
|
|
fmt.Fprintf(os.Stderr, " %s <<< \"22101 12102 11210 20302 22072 122\"\n", os.Args[0])
|
|
|
|
|
fmt.Fprintf(os.Stderr, " %s -r < file.txt\n", os.Args[0])
|
|
|
|
|
fmt.Fprintf(os.Stderr, " %s\n", os.Args[0])
|
|
|
|
|
}
|
|
|
|
|
|
|
|
|
|
flag.Parse()
|
|
|
|
|
|
|
|
|
|
// Create a map to store sound data for each character
|
|
|
|
|