Skip to content

Latest commit

 

History

History
33 lines (23 loc) · 683 Bytes

README.mkd

File metadata and controls

33 lines (23 loc) · 683 Bytes

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:

package main

import (
	"os"

	"github.com/galdor/go-cmdline"
)

func main() {
	cmdline := cmdline.New()
	cmdline.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 [email protected].