A parser of the Shell Command Language.
$ go get -u github.com/hattya/go.sh
package main
import (
"fmt"
"github.com/davecgh/go-spew/spew"
"github.com/hattya/go.sh/parser"
)
func main() {
cmd, comments, err := parser.ParseCommand("<stdin>", "echo Hello, World!")
if err != nil {
fmt.Println(err)
return
}
spew.Dump(cmd)
spew.Dump(comments)
}
go.sh is distributed under the terms of the MIT License.