Accept multiple strings as command-line arguments
This commit is contained in:
parent
a2ea76179a
commit
a562d6acdb
@ -3,6 +3,7 @@ package main
|
|||||||
import (
|
import (
|
||||||
"fmt"
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
"strings"
|
||||||
)
|
)
|
||||||
|
|
||||||
func yes(word string) {
|
func yes(word string) {
|
||||||
@ -15,6 +16,7 @@ func main() {
|
|||||||
if len(os.Args) == 1 {
|
if len(os.Args) == 1 {
|
||||||
yes("y")
|
yes("y")
|
||||||
} else {
|
} else {
|
||||||
yes(os.Args[1])
|
word := strings.Join(os.Args[1:], " ")
|
||||||
|
yes(word)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
Loading…
Reference in New Issue
Block a user