getopt-like flags package for golang,
Go Shell HTML Makefile
Switch branches/tags
Nothing to show
Latest commit 0b8effe Jun 4, 2017
ryo1kato and droundy No duplicate Label for short and long options for Help() (#11)
* fix broken test for "-h" and remove deprecated Makefiles

* -h (for --happy) conflicts with the default --help
* Use of $(GOROOT)/src/Make.inc is obsoleted.

* No duplicate label for short and long opts in Help()
Permalink
Failed to load latest commit information.
example
git use gofmt on working directory in post-commit. Jul 11, 2010
test-program No duplicate Label for short and long options for Help() (#11) Jun 4, 2017
.build use gotgo for string slices. Mar 8, 2010
.gitignore add simpler example program. Oct 4, 2010
.test No duplicate Label for short and long options for Help() (#11) Jun 4, 2017
LICENSE add BSD license Aug 15, 2015
README.md use github link for example man page, html version. Oct 4, 2010
goopt.go No duplicate Label for short and long options for Help() (#11) Jun 4, 2017
setup-git.sh add script to set up git pre-commit hooks. Jul 10, 2010
slice.go Gofmt Jul 10, 2010

README.md

goopt

A getopt-like processor of command-line flags. It works much like the "flag" package, only it processes arguments in a way that is compatible with the getopt_long syntax, which is an extension of the syntax recommended by POSIX.

Example program

The example program named example/example.go, is meant to be more useful for someone trying to see how the package works. It comes with a makefile demonstrating how to do some nice tricks, such as enabling bash completion on your flags, and generating man pages and html versions of the man page (see the man page for the example program).

Test suite

The test suite is the file .test, which compiles and verifies the output of the program in the test-program directory, as well as the example program. You can configure git to run the test suite automatically by running the setup-git.sh script.

Documentation

Once the package is installed via goinstall, use the following to view the documentation:

godoc --http=:6060

If you installed it from github, you will want to do this from the source directory:

godoc --http=:6060 --path=.

This will run in the foreground, so do it in a terminal without anything important in it. Then you can go to http://localhost:6060/ and navigate via the package directory to the documentation or the left-hand navigation, depending on if it was goinstalled or run from a git clone.