| 1 | package main |
| 2 | |
| 3 | import ( |
| 4 | "fmt" |
| 5 | "github.com/docopt/docopt-go" |
| 6 | ) |
| 7 | |
| 8 | func main() { |
| 9 | usage := `Example of program which uses [options] shortcut in pattern. |
| 10 | |
| 11 | Usage: |
| 12 | options_shortcut [options] <port> |
| 13 | |
| 14 | Options: |
| 15 | -h --help show this help message and exit |
| 16 | --version show version and exit |
| 17 | -n, --number N use N as a number |
| 18 | -t, --timeout TIMEOUT set timeout TIMEOUT seconds |
| 19 | --apply apply changes to database |
| 20 | -q operate in quiet mode` |
| 21 | |
| 22 | arguments, _ := docopt.ParseArgs(usage, nil, "1.0.0rc2") |
| 23 | fmt.Println(arguments) |
| 24 | } |