https://github.com/hattya/go.sh
A parser of the Shell Command Language
https://github.com/hattya/go.sh
go parser posix shell
Last synced: 10 months ago
JSON representation
A parser of the Shell Command Language
- Host: GitHub
- URL: https://github.com/hattya/go.sh
- Owner: hattya
- License: mit
- Created: 2018-03-26T13:34:12.000Z (almost 8 years ago)
- Default Branch: master
- Last Pushed: 2025-03-14T12:58:52.000Z (11 months ago)
- Last Synced: 2025-03-27T21:11:43.742Z (10 months ago)
- Topics: go, parser, posix, shell
- Language: Go
- Size: 328 KB
- Stars: 5
- Watchers: 3
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE.txt
Awesome Lists containing this project
README
# go.sh
A parser of the [Shell Command Language](https://pubs.opengroup.org/onlinepubs/9799919799/utilities/V3_chap02.html).
[](https://pkg.go.dev/github.com/hattya/go.sh)
[](https://github.com/hattya/go.sh/actions/workflows/ci.yml)
[](https://ci.appveyor.com/project/hattya/go-sh)
[](https://codecov.io/gh/hattya/go.sh)
## Installation
```console
$ go get github.com/hattya/go.sh
```
## Usage
```go
package main
import (
"fmt"
"github.com/davecgh/go-spew/spew"
"github.com/hattya/go.sh/parser"
)
func main() {
cmd, comments, err := parser.ParseCommand("", "echo Hello, World!")
if err != nil {
fmt.Println(err)
return
}
spew.Dump(cmd)
spew.Dump(comments)
}
```
## License
go.sh is distributed under the terms of the MIT License.