https://github.com/galdor/go-cmdline
A command line parser written in Go
https://github.com/galdor/go-cmdline
command-line-parser go golang
Last synced: 3 months ago
JSON representation
A command line parser written in Go
- Host: GitHub
- URL: https://github.com/galdor/go-cmdline
- Owner: galdor
- License: isc
- Created: 2016-08-11T17:47:03.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2021-11-20T10:31:55.000Z (about 4 years ago)
- Last Synced: 2025-04-11T17:58:45.177Z (9 months ago)
- Topics: command-line-parser, go, golang
- Language: Go
- Homepage:
- Size: 11.7 KB
- Stars: 12
- Watchers: 5
- Forks: 5
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# go-cmdline
## Introduction
`cmdline` is a Go library to parse command line options (with optional default
values), arguments and subcommands.
## Usage
The following example is the simplest `cmdline` application possible:
```go
package main
import (
"os"
"github.com/galdor/go-cmdline"
)
func main() {
cl := cmdline.New()
cl.Parse(os.Args)
}
```
The resulting application handles `-h` and `--help`.
The `examples` directory contains examples for the various features of
`cmdline`. You can run them with `go run`. Feel free to copy and use these
examples in your own application.
## Contact
If you have an idea or a question, email me at .