miller/experiments/cli-parser/cliparse.go
2021-03-28 16:53:56 -04:00

27 lines
429 B
Go

// go mod init cliparse.go
// go get golang.org/x/sys
// go get github.com/kballard/go-shellquote
package main
import (
"fmt"
"os"
"cliparse/arch"
)
func main() {
fmt.Println("-- os.Args:")
for i, arg := range os.Args {
fmt.Printf("args[%d] <<%s>>\n", i, arg)
}
fmt.Println()
fmt.Println("-- canonical args:")
args := arch.GetMainArgs()
for i, arg := range args {
fmt.Printf("args[%d] <<%s>>\n", i, arg)
}
}