Making a mess with command line parsing

This commit is contained in:
2022-05-11 22:11:05 -04:00
parent 512eddc1ab
commit af7d5c6e14
9 changed files with 376 additions and 0 deletions

24
argh/cmd/argh/main.go Normal file
View File

@@ -0,0 +1,24 @@
package main
import (
"encoding/json"
"fmt"
"log"
"os"
"git.meatballhat.com/x/box-o-sand/argh"
)
func main() {
ast, err := argh.ParseArgs(os.Args)
if err != nil {
log.Fatal(err)
}
b, err := json.MarshalIndent(ast, "", " ")
if err != nil {
log.Fatal(err)
}
fmt.Println(string(b))
}