20 lines
307 B
Go
20 lines
307 B
Go
package main
|
|
|
|
import (
|
|
"fmt"
|
|
"os"
|
|
"strings"
|
|
)
|
|
|
|
func main() {
|
|
fmt.Printf("command: %s\n", os.Args[0])
|
|
fmt.Printf("args: %s\n", strings.Join(os.Args[1:], " "))
|
|
str := ""
|
|
deli := " "
|
|
for i, j := range os.Args[1:] {
|
|
str += fmt.Sprintf("index: %d value: %s", i, j)
|
|
str += deli
|
|
}
|
|
fmt.Println(str)
|
|
}
|