An open API service indexing awesome lists of open source software.

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

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 .