Skip to content

A command line parser written in Go

License

Notifications You must be signed in to change notification settings

galdor/go-cmdline

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

16 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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() {
	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 khaelin@gmail.com.

About

A command line parser written in Go

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Languages