Skip to content

AntonAderum/antargs

Repository files navigation

antargs

An argument package for go.

This is a work in progress. Not usable at the moment.

Basic usage:

// setup
antArg, _ := New("myTestProgram", "myTestProgram is a very nice program!")
antArg.NewArg("--say", "What should I say?", false, "", 1)
antArg.NewArg("--style", "In what style should I say it?", false, "", 1)

// parse
antArg.Parse(os.Args)

// use
sayArg := antArg.findArgument("--say")
sayValue := arg.values[0]
styleValue := antArg.findArgument("--style").values[0]

if styleValue == "shout" {
    sayValue = ToUpper(sayValue)
}
fmt.Printf("I say: %s", sayValue)

terminal:

$ ./myTestProgram --say "You're A Wizard, Harry!" --style shout
$ I say: YOU'RE A WIZARD, HARRY!

About

A small and strong argument package for go

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages