Skip to content

Commit

Permalink
Adding quick ref for goptions tag
Browse files Browse the repository at this point in the history
  • Loading branch information
itzg committed Feb 23, 2015
1 parent d04e758 commit 39e717b
Showing 1 changed file with 52 additions and 1 deletion.
53 changes: 52 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ by the tags in a (possibly anonymous) struct.

# Example

```Go
```go
package main

import (
Expand Down Expand Up @@ -59,5 +59,56 @@ Verbs:
--script Script to exectute
```

# Quick Reference

## goptions

Each field of your struct can be tagged with a `goptions`

```go
FieldName type `goptions:"-S, --long, options..."`
```

Where the short options (`-S`) are declared with a single dash and
long options (`--long`) are declared with two dashes. Either or
both may be declared.

After the short/long option names are one or more of the following:

### Global Options

* description='...'
* obligatory
* mutexgroup='GROUP_NAME'

### os.File specific

* create
* append
* rdonly
* wronly
* rdwr
* excl
* sync
* trunc
* perm=0777

## Supported Types

* bool
* string
* float64
* float32
* int
* int64
* int32
* goptions.Help
* *os.File
* *net.TCPAddr
* *url.URL
* time.Duration



---
Version 2.5.9

0 comments on commit 39e717b

Please sign in to comment.