~sircmpwn/getopt

godoc.org -> godocs.io
Allow parsing of flags from array
Print error when ExitOnError is set
Improve output of flagset.Usage()

This patch changes the autogenerated Usage() page to a more traditional
form known from classical tools. The generated table is now more compact
and easier to grasp.

Before:

$ go run . -h
Usage of /tmp/go-build277420169/b001/exe/authorized_fps:
  -a
        Add fingerprint alias: <NI> <Alias>
  -d
        Print debug output
  -f (default "")
        Send this file
  -g
        Generate a keypair
  -h
        Show help page and exit
  -r
        Receive file instead of sending
  -s
        Show own fingerprint

After:

$ go run . -h
Usage of /tmp/go-build869148344/b001/exe/authorized_fps:

  -a    Add fingerprint alias: <NI> <Alias>
  -d    Print debug output
  -f    Send this file (default "")
  -g    Generate a keypair
  -h    Show help page and exit
  -r    Receive file instead of sending
  -s    Show own fingerprint
Fix godoc for getopt.go
5509d682 — Philip K 2 years ago
Implemented flag-like interface
Fix os.Args usage in example code
Change optind to behave like posix getopt

This change makes optind returned by Getopt behave like optind in the
posix getopt. When no parameters are given, optind is 1 (since optind=0
== program name and is not an option).

The tests have been updated to reflect this behavior, and a new test to
test that optind is 1 when no options are passed in is added.

Note: this is a breaking change, so any applications that use getopt
will need to be updated accordingly. It seems that in most cases the
only change needed is to pass in the entire os.Args instead of a slice
 at [1:].
Fix example code (range)
Fix short-form arguments (e.g. "f:" w/-fexample)
Fix switch..case in example code
Add .editorconfig
Reduce indentation of example block
Correct indentation in example code
Correct issues with .build.yml
Extend README.md
Add .build.yml
Add package godocs
Initial commit