diff --git a/.gitignore b/.gitignore
index 3f134dd..7b50011 100644
--- a/.gitignore
+++ b/.gitignore
@@ -1,6 +1,5 @@
+cmd/password/.build
+cmd/password/password
dist
frontend/assets/*
js/node_modules/*
-password
-password_darwin_amd64
-PasswordGenerator.alfredworkflow
diff --git a/.gitmodules b/.gitmodules
index 82a6236..e69de29 100644
--- a/.gitmodules
+++ b/.gitmodules
@@ -1,3 +0,0 @@
-[submodule "alfred-workflow/lib"]
- path = alfred-workflow/lib
- url = https://github.com/deanishe/alfred-workflow.git
diff --git a/.repo-runner.yaml b/.repo-runner.yaml
index 7719755..5c300ad 100644
--- a/.repo-runner.yaml
+++ b/.repo-runner.yaml
@@ -1,12 +1,11 @@
---
-image: "quay.io/luzifer/repo-runner-image"
-checkout_dir: /go/src/github.com/Luzifer/password
+image: "reporunner/golang-alpine"
+checkout_dir: /src
commands:
- - apk --update add zip
- - git submodule update --init --recursive
- - make publish workflow
+ - make publish
environment:
CGO_ENABLED: 0
+ PACKAGES: .
diff --git a/.travis.yml b/.travis.yml
index 2719233..97aae24 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -1,11 +1,10 @@
language: go
go:
- - 1.7.x
- - 1.8.x
- - 1.9.x
- 1.10.x
- 1.11.x
+ - 1.12.x
- tip
-script: go test -v --bench=. github.com/Luzifer/password github.com/Luzifer/password/lib
+install: go get -v github.com/Luzifer/password/lib
+script: go test -v --bench=. github.com/Luzifer/password/lib
diff --git a/Dockerfile b/Dockerfile
index 582cfbd..d8b9e16 100644
--- a/Dockerfile
+++ b/Dockerfile
@@ -1,7 +1,7 @@
FROM golang:alpine as builder
-COPY . /go/src/github.com/Luzifer/password
-WORKDIR /go/src/github.com/Luzifer/password
+COPY . /src/github.com/Luzifer/password
+WORKDIR /src/github.com/Luzifer/password/cmd/password
RUN set -ex \
&& apk add --update git \
diff --git a/Gopkg.lock b/Gopkg.lock
deleted file mode 100644
index 0f54fbc..0000000
--- a/Gopkg.lock
+++ /dev/null
@@ -1,106 +0,0 @@
-# This file is autogenerated, do not edit; changes may be undone by the next 'dep ensure'.
-
-
-[[projects]]
- digest = "1:70792ca3a262117f2135feb54379a0399fc8afb267edc64a16ee278dd431a619"
- name = "github.com/Luzifer/go_helpers"
- packages = [
- "accessLogger",
- "http",
- "str",
- ]
- pruneopts = "NUT"
- revision = "bbca4398656b348ce285438ca3dffb1fce6a3f4b"
- version = "v2.8.1"
-
-[[projects]]
- digest = "1:c01767916c59f084bb7c41a7d5877c0f3099b1595cfa066e84ec6ad6b084dd89"
- name = "github.com/gorilla/context"
- packages = ["."]
- pruneopts = "NUT"
- revision = "08b5f424b9271eedf6f9f0ce86cb9396ed337a42"
- version = "v1.1.1"
-
-[[projects]]
- digest = "1:bf5cf1d53d703332e9bd8984c69784645b73a938317bf5ace9aadf20ac49379a"
- name = "github.com/gorilla/mux"
- packages = ["."]
- pruneopts = "NUT"
- revision = "e3702bed27f0d39777b0b37b664b6280e8ef8fbf"
- version = "v1.6.2"
-
-[[projects]]
- digest = "1:406338ad39ab2e37b7f4452906442a3dbf0eb3379dd1f06aafb5c07e769a5fbb"
- name = "github.com/inconshreveable/mousetrap"
- packages = ["."]
- pruneopts = "NUT"
- revision = "76626ae9c91c4f2a10f34cad8ce83ea42c93bb75"
- version = "v1.0"
-
-[[projects]]
- digest = "1:14715f705ff5dfe0ffd6571d7d201dd8e921030f8070321a79380d8ca4ec1a24"
- name = "github.com/pkg/errors"
- packages = ["."]
- pruneopts = "NUT"
- revision = "ba968bfe8b2f7e042a574c888954fccecfa385b4"
- version = "v0.8.1"
-
-[[projects]]
- digest = "1:343d44e06621142ab09ae0c76c1799104cdfddd3ffb445d78b1adf8dc3ffaf3d"
- name = "github.com/spf13/cobra"
- packages = ["."]
- pruneopts = "NUT"
- revision = "ef82de70bb3f60c65fb8eebacbb2d122ef517385"
- version = "v0.0.3"
-
-[[projects]]
- digest = "1:9d8420bbf131d1618bde6530af37c3799340d3762cc47210c1d9532a4c3a2779"
- name = "github.com/spf13/pflag"
- packages = ["."]
- pruneopts = "NUT"
- revision = "298182f68c66c05229eb03ac171abe6e309ee79a"
- version = "v1.0.3"
-
-[[projects]]
- branch = "master"
- digest = "1:e762d2447df27cace4112a07ddc64e7c71dc0bc5d512a59f5d2b98c5133e8e71"
- name = "github.com/tredoe/osutil"
- packages = [
- "user/crypt",
- "user/crypt/apr1_crypt",
- "user/crypt/common",
- "user/crypt/md5_crypt",
- "user/crypt/sha256_crypt",
- "user/crypt/sha512_crypt",
- ]
- pruneopts = "NUT"
- revision = "7d3ee1afa71c90fd1514c8f557ae6c5f414208eb"
-
-[[projects]]
- branch = "master"
- digest = "1:1ecf2a49df33be51e757d0033d5d51d5f784f35f68e5a38f797b2d3f03357d71"
- name = "golang.org/x/crypto"
- packages = [
- "bcrypt",
- "blowfish",
- ]
- pruneopts = "NUT"
- revision = "505ab145d0a99da450461ae2c1a9f6cd10d1f447"
-
-[solve-meta]
- analyzer-name = "dep"
- analyzer-version = 1
- input-imports = [
- "github.com/Luzifer/go_helpers/http",
- "github.com/Luzifer/go_helpers/str",
- "github.com/gorilla/mux",
- "github.com/pkg/errors",
- "github.com/spf13/cobra",
- "github.com/tredoe/osutil/user/crypt",
- "github.com/tredoe/osutil/user/crypt/apr1_crypt",
- "github.com/tredoe/osutil/user/crypt/sha256_crypt",
- "github.com/tredoe/osutil/user/crypt/sha512_crypt",
- "golang.org/x/crypto/bcrypt",
- ]
- solver-name = "gps-cdcl"
- solver-version = 1
diff --git a/Gopkg.toml b/Gopkg.toml
deleted file mode 100644
index e90d525..0000000
--- a/Gopkg.toml
+++ /dev/null
@@ -1,51 +0,0 @@
-# Gopkg.toml example
-#
-# Refer to https://golang.github.io/dep/docs/Gopkg.toml.html
-# for detailed Gopkg.toml documentation.
-#
-# required = ["github.com/user/thing/cmd/thing"]
-# ignored = ["github.com/user/project/pkgX", "bitbucket.org/user/project/pkgA/pkgY"]
-#
-# [[constraint]]
-# name = "github.com/user/project"
-# version = "1.0.0"
-#
-# [[constraint]]
-# name = "github.com/user/project2"
-# branch = "dev"
-# source = "github.com/myfork/project2"
-#
-# [[override]]
-# name = "github.com/x/y"
-# version = "2.4.0"
-#
-# [prune]
-# non-go = false
-# go-tests = true
-# unused-packages = true
-
-
-[[constraint]]
- name = "github.com/Luzifer/go_helpers"
- version = "2.8.1"
-
-[[constraint]]
- name = "github.com/gorilla/mux"
- version = "1.6.2"
-
-[[constraint]]
- name = "github.com/spf13/cobra"
- version = "0.0.3"
-
-[[constraint]]
- branch = "master"
- name = "github.com/tredoe/osutil"
-
-[[constraint]]
- branch = "master"
- name = "golang.org/x/crypto"
-
-[prune]
- non-go = true
- go-tests = true
- unused-packages = true
diff --git a/Makefile b/Makefile
index fc026ea..f24ce18 100644
--- a/Makefile
+++ b/Makefile
@@ -10,16 +10,13 @@ compile_js:
sh -c "yarn && npx webpack"
debug:
- go-bindata --debug frontend/...
+ go-bindata --debug -o cmd/password/bindata.go --pkg=main frontend/...
go run *.go serve
pack: compile_js
- go-bindata -modtime 1 frontend/...
+ go-bindata -modtime 1 -o cmd/password/bindata.go --pkg=main frontend/...
bash generateXKCDWordList.sh
publish:
- curl -sSLo golang.sh https://raw.githubusercontent.com/Luzifer/github-publish/master/golang.sh
- bash golang.sh
-
-workflow:
- bash build-workflow.sh
+ curl -sSLo cmd/password/golang.sh https://raw.githubusercontent.com/Luzifer/github-publish/master/golang.sh
+ cd cmd/password && bash golang.sh
diff --git a/README.md b/README.md
index 6de3e87..1050065 100644
--- a/README.md
+++ b/README.md
@@ -20,17 +20,6 @@ For the security of the passwords there are several assertions:
My service [Secure Password](https://passwd.fyi/) is powered by this app and will provide you with secure passwords.
-### Via [Alfred](https://www.alfredapp.com/)
-
-_(No longer actively maintained as I no longer use OSX / Alfred. The current version stays until it gets reported to be broken and will then get removed.)_
-
-1. Ensure you do have Alfred 3 and have enabled the Powerpack
-2. Download and open the `PasswordGenerator.alfredworkflow` from [Github releases](https://github.com/Luzifer/password/releases/latest)
-3. Let Alfred install the workflow
-4. Generate passwords using `pwd 12`, with special characters `pwd 12 s` or [XKCD style](https://xkcd.com/936/) `pwd 4 x`
-
-The workflow is set up to automatically check for updates once a day. If you want to check for updates manually open Alfred, enter `pwd workflow:update` and press enter.
-
### Via CLI
1. Download the compiled binary from [Github releases](https://github.com/Luzifer/password/releases/latest)
@@ -95,6 +84,18 @@ $ curl https://passwd.fyi/v1/getPassword?length=20&special=true
0M4L-1[lT:@2&7,p,o-;
```
+#### As library in your own code
+
+```go
+package main
+
+import pwd "github.com/Luzifer/password/v2/lib"
+
+func getPassword() (string, error) {
+ return pwd.NewSecurePassword().GeneratePassword(16, false)
+}
+```
+
## Benchmark / Test
Tests and benchmark are run by Travis CI at every push to this repository:
diff --git a/alfred-workflow/.gitignore b/alfred-workflow/.gitignore
deleted file mode 100644
index 0d20b64..0000000
--- a/alfred-workflow/.gitignore
+++ /dev/null
@@ -1 +0,0 @@
-*.pyc
diff --git a/alfred-workflow/exec.py b/alfred-workflow/exec.py
deleted file mode 100644
index 8673dc6..0000000
--- a/alfred-workflow/exec.py
+++ /dev/null
@@ -1,75 +0,0 @@
-# encoding: utf-8
-
-import subprocess
-import sys
-import json
-from workflow import Workflow, ICON_WEB, web
-
-descriptions = {
- "htpasswd_apr1": "APR1 (htpasswd)",
- "htpasswd_bcrypt": "bcrypt (htpasswd)",
- "htpasswd_sha256": "SHA256 (htpasswd)",
- "htpasswd_sha512": "SHA512 (htpasswd)",
- "password": "Password",
- "sha1": "SHA1",
- "sha256": "SHA256",
- "sha512": "SHA512",
-}
-
-
-def main(wf):
- password_length = 20
- use_special = False
- use_xkcd = False
-
- if len(wf.args):
- for arg in wf.args[0].split():
- if arg.isdigit():
- password_length = int(arg)
- elif arg == 's':
- use_special = True
- elif arg == 'x':
- use_xkcd = True
-
- if password_length < 4 or password_length > 256:
- wf.add_item(title="Password length out of bounds",
- subtitle="Please use a reasonable password length between 4 and 256")
- wf.send_feedback()
- return 1
-
- command = ["./password_darwin_amd64",
- "get", "-j", "-l",
- str(password_length)]
- if use_special:
- command.append("-s")
- if use_xkcd:
- command.append("-x")
- result = json.loads(subprocess.check_output(command).strip())
-
- hashed = []
- for key, value in result.iteritems():
- hashed.append("{}: {}".format(key, value))
-
- wf.add_item(title=result['password'],
- subtitle="Press Cmd+C to copy",
- arg=result['password'],
- valid=True)
- wf.add_item(title="Copy hashed versions",
- subtitle="Press Cmd+C to copy",
- arg="\n".join(hashed),
- valid=True)
- wf.send_feedback()
-
- return 0
-
-
-if __name__ == "__main__":
- wf = Workflow(update_settings={
- 'github_slug': 'Luzifer/password',
- })
-
- if wf.update_available:
- # Download new version and tell Alfred to install it
- wf.start_update()
-
- sys.exit(wf.run(main))
diff --git a/alfred-workflow/icon.png b/alfred-workflow/icon.png
deleted file mode 100644
index 32c10c2..0000000
Binary files a/alfred-workflow/icon.png and /dev/null differ
diff --git a/alfred-workflow/info.plist b/alfred-workflow/info.plist
deleted file mode 100644
index 896ac2f..0000000
--- a/alfred-workflow/info.plist
+++ /dev/null
@@ -1,120 +0,0 @@
-
-
-
-
- bundleid
- io.luzifer.pwd
- category
- Tools
- connections
-
- F8CBCF9B-3B33-400E-B6AD-6B8500938BA4
-
-
- destinationuid
- F417810A-4CC7-4844-9B6E-DA2D6B40543C
- modifiers
- 0
- modifiersubtext
-
- vitoclose
-
-
-
-
- createdby
- Knut Ahlers
- description
- Generate secure passwords using Luzifer/password tool
- disabled
-
- name
- Password Generator
- objects
-
-
- config
-
- autopaste
-
- clipboardtext
- {query}
- transient
-
-
- type
- alfred.workflow.output.clipboard
- uid
- F417810A-4CC7-4844-9B6E-DA2D6B40543C
- version
- 2
-
-
- config
-
- alfredfiltersresults
-
- argumenttrimmode
- 0
- argumenttype
- 1
- escaping
- 0
- keyword
- pwd
- queuedelaycustom
- 1
- queuedelayimmediatelyinitially
-
- queuedelaymode
- 0
- queuemode
- 1
- runningsubtext
- Generating password...
- script
- python exec.py "$1"
- scriptargtype
- 1
- scriptfile
-
- subtext
- Generates a secure password with <n> length
- title
- Password Generator
- type
- 0
- withspace
-
-
- type
- alfred.workflow.input.scriptfilter
- uid
- F8CBCF9B-3B33-400E-B6AD-6B8500938BA4
- version
- 2
-
-
- readme
-
- uidata
-
- F417810A-4CC7-4844-9B6E-DA2D6B40543C
-
- xpos
- 700
- ypos
- 170
-
- F8CBCF9B-3B33-400E-B6AD-6B8500938BA4
-
- xpos
- 300
- ypos
- 170
-
-
- webaddress
- https://github.com/Luzifer/password
-
-
diff --git a/alfred-workflow/lib b/alfred-workflow/lib
deleted file mode 160000
index 183a232..0000000
--- a/alfred-workflow/lib
+++ /dev/null
@@ -1 +0,0 @@
-Subproject commit 183a2326cfe4fa11af3c1cd186579a35cef1792b
diff --git a/build-workflow.sh b/build-workflow.sh
deleted file mode 100644
index f845573..0000000
--- a/build-workflow.sh
+++ /dev/null
@@ -1,34 +0,0 @@
-#!/bin/bash
-set -euxo pipefail
-
-# Check for a publishable version
-VERSION=$(git describe --tags --exact-match || echo "notag")
-
-# Collect assets to pack
-mkdir -p dist
-unzip ./.build/password_darwin_amd64.zip -d dist
-cp -r \
- alfred-workflow/exec.py \
- alfred-workflow/icon.png \
- alfred-workflow/info.plist \
- alfred-workflow/lib/workflow \
- dist
-
-# In order to have a valid version number on no tags for testing
-git describe --tags >dist/version
-
-# Create ZIP
-cd dist
-zip -r -9 ../PasswordGenerator.alfredworkflow *
-cd -
-
-# If there is no version tag the artifact is not to be published
-if (test "${VERSION}" == "notag"); then
- echo "No exact tag found, no publishing required."
- exit 0
-fi
-
-# Upload to Github releases
-github-release upload --user luzifer --repo password --tag ${VERSION} \
- --name PasswordGenerator.alfredworkflow \
- --file PasswordGenerator.alfredworkflow
diff --git a/bindata.go b/cmd/password/bindata.go
similarity index 99%
rename from bindata.go
rename to cmd/password/bindata.go
index 6604577..05bda7a 100644
--- a/bindata.go
+++ b/cmd/password/bindata.go
@@ -20193,60 +20193,60 @@ func bindataFrontendAssetsFfcc050b2d92d4b14a4fcb527ee0bcc8woff() (*asset, error)
}
var _bindataFrontendIndexhtml = []byte(
- "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x58\xef\x8e\xdb\xb8\x11\xff\x9e\xa7\x98\x53\x50\xf4\xcb\xc9\x4a\x2e" +
- "\xc1\xe1\x9a\x4a\x2e\x82\xcd\xb5\xd9\x36\x87\xa4\xd8\x14\x68\x3e\x15\x23\x71\x24\x31\xa6\x48\x81\x1c\xda\xeb\xbe" +
- "\x48\x1f\xa8\x2f\x56\x90\x92\xbc\x96\x2d\xdf\x7a\x0f\x45\xf6\x8b\xb9\xe4\x8f\xe4\xfc\xfb\xcd\x0c\x95\x7f\xf7\xee" +
- "\xe3\xcd\xe7\x2f\x9f\x7e\x86\x96\x3b\xb5\x7e\x96\x87\x1f\x50\xa8\x9b\x22\x21\x9d\xac\x9f\x01\xe4\x2d\xa1\x08\x03" +
- "\x80\xbc\x23\x46\xa8\x5a\xb4\x8e\xb8\x48\x3c\xd7\xe9\x4f\xc9\xf1\x92\xc6\x8e\x8a\x64\x2b\x69\xd7\x1b\xcb\x09\x54" +
- "\x46\x33\x69\x2e\x92\x9d\x14\xdc\x16\x82\xb6\xb2\xa2\x34\xfe\xf3\x3d\x48\x2d\x59\xa2\x4a\x5d\x85\x8a\x8a\x97\xdf" +
- "\x83\x6b\xad\xd4\x9b\x94\x4d\x5a\x4b\x2e\xb4\x99\x8e\x66\xc9\x8a\xd6\x77\x54\x79\x4b\xf0\x09\x9d\xdb\x19\x2b\xf2" +
- "\x6c\x98\x7e\x36\x60\xbe\x4b\x53\xf8\x60\x50\x00\xf6\x3d\xb8\xca\xca\x9e\x81\xd0\xaa\x3d\xb0\x81\xde\xd2\x96\x34" +
- "\x43\xa9\x50\x6f\xe0\xfd\xe7\x5f\x3e\xc0\x4e\x72\x6b\x3c\x83\xe3\xbd\x92\xba\x81\x34\x1d\x2f\x1b\xf7\x3a\x5b\x15" +
- "\x09\x3a\x47\xec\xb2\xd2\x6b\xa1\x68\xf5\xd5\x25\xeb\x3c\x1b\xd6\xa3\x61\xb2\xc9\x32\x79\x69\xc4\x7e\xdc\xaf\x71" +
- "\x0b\x95\x42\xe7\x8a\x44\xe3\xb6\x44\x0b\xc3\x4f\x4a\xf7\x3d\x6a\x91\xaa\x66\x9a\x50\xb2\x69\x19\xca\x66\x18\x8c" +
- "\xca\x02\xe4\x38\xdf\x9f\x96\x16\xb5\x48\xa0\xb5\x54\x17\xc9\xf3\xe4\xdc\x10\x78\xd8\x5a\x7a\x66\xa3\x4f\xf6\xb3" +
- "\x69\x1a\x45\x36\x01\xde\xf7\x54\x24\x03\x26\x01\x81\x8c\xe3\x5a\x91\x54\x46\x29\xec\x1d\x4d\xd3\x68\x9b\xe0\xe1" +
- "\xe7\xc3\x11\x77\xbe\x0f\xfe\x24\x71\x33\xf8\x33\x01\xb4\x12\xd3\xe0\x5d\x6b\xd4\xe1\xa6\x0b\xb0\x41\x71\x12\x45" +
- "\x52\xa3\x0a\x57\xc4\x59\x85\x25\xa9\x22\xf9\x1c\x05\x08\x26\x91\x0d\xb2\x34\xfa\x60\x87\xe0\x8b\x1e\x2f\x28\x93" +
- "\xca\x2a\x40\xf3\x2c\x40\x0e\xea\x67\x83\x6e\x63\x4c\x00\xe4\x42\x1e\x9c\x31\x69\x38\x59\xff\x41\x63\x29\x2e\x2a" +
- "\x70\x24\x8b\x57\x27\x92\x04\x47\x77\x36\x45\xcf\xe6\x08\x07\x90\x2b\x79\x84\x4c\x25\x53\x37\x5b\x3f\xf1\x70\xaa" +
- "\xa4\xde\x4c\xde\x6d\x99\x7b\xf7\x26\xcb\x1a\xc9\xad\x2f\x57\x95\xe9\xb2\x0f\xfe\xdf\xb2\x26\x9b\xf5\xa3\xbb\x9f" +
- "\x6f\x25\xa6\xa8\x6a\x4b\x22\x59\xbf\x8d\xbf\xf0\xf3\x3d\x93\x76\xd2\xe8\xa3\x58\x18\x0c\xa2\xe4\x37\x17\xad\x97" +
- "\xc9\xfa\xed\xa7\x5b\x78\x67\x2a\xdf\x91\xe6\xe8\xd5\x5f\x15\x2c\xcf\xbc\x3a\xf8\xec\x82\xa9\x9f\x6a\xe2\x91\x09" +
- "\xf3\x90\x1f\xf7\x94\xac\xa1\x64\x9d\x0a\xaa\xd1\x2b\x9e\x22\xa2\xe4\x53\x56\x74\x46\xa0\x3a\xa5\x84\x23\x66\xa9" +
- "\x1b\xf7\x4b\x5c\x9c\x5f\x0b\x90\x1f\x24\xab\xd1\x41\x1d\x48\xd2\x8c\x11\xdf\x4a\x21\x48\x17\x09\x5b\x4f\x21\x74" +
- "\xe5\x1a\xee\xc6\xb3\xe6\xb2\x1f\xc2\xf8\xd7\x0d\x36\x8d\x85\xdc\x8e\xb9\x27\xd3\xb8\x9d\x12\xe2\x2c\xf4\x35\xa3" +
- "\xd4\x64\xa1\xe3\xf4\xf5\x43\xa2\x39\x82\x58\xb3\x83\xaf\xde\xb1\xac\xf7\xe9\x98\xb4\xd3\x4e\xa4\x15\x69\x26\x7b" +
- "\x4c\x83\x39\xa3\xd2\x7b\x97\xbe\xfc\x01\xc2\xc8\x75\xe9\x4f\x71\xd0\x89\xf4\xc7\xe4\xc8\x9d\xf3\x4d\x5f\x7d\x57" +
- "\x1a\xb6\x33\x9e\x47\x4c\x3f\x21\x14\xa1\x80\xb3\x8b\x87\xbf\x5b\xd8\x49\xa5\xa0\x21\x4d\x16\x99\x00\x41\xd3\x0e" +
- "\xdc\x90\x10\xa7\x30\x04\xda\x92\xdd\xc3\xab\x17\x61\xc1\x68\xe1\x56\xf0\x57\xef\x18\x2a\x25\xab\x0d\x70\x7b\x84" +
- "\x64\x03\x1b\xa2\x3e\x4e\x56\xde\xda\x50\x24\x8c\xa6\x15\x9c\x38\xa4\x9f\xfb\x22\x5a\xfc\x82\x82\x15\x5a\x01\x5d" +
- "\x99\xbe\x3a\x55\xf0\x04\x93\x86\xe2\xb1\xa0\xe2\x17\xe3\xed\x41\xc0\x13\x31\x0e\x9e\xbe\x78\x68\x28\x44\xe7\x31" +
- "\x79\x84\xaa\x8d\xed\xd2\xc6\x1a\xdf\x9f\xc1\x42\xf0\xea\xde\xf3\x0c\x3a\xe6\xf8\xc9\x21\x31\x59\xd6\xa6\xf2\x8e" +
- "\xc4\x6d\x00\x4f\x55\x85\xe9\x9e\x13\xd8\xa2\xf2\x54\x24\xab\xd5\xea\x5c\x88\x05\xe9\xaf\x50\xa8\x36\x66\x29\x10" +
- "\x8e\x71\xbd\x35\x8d\x25\xe7\x96\x14\x5a\x80\xa5\x25\xda\x24\xd6\x7d\x1a\xfb\x92\x37\xf0\xf2\xc5\x8b\xdf\xfd\x31" +
- "\x70\xf2\x4c\xa0\xeb\x04\x7f\x3c\x24\x7e\x63\x34\xfc\xf9\xed\xdf\xff\x4f\x31\xf0\x90\x31\x8e\x26\x95\x5c\xe7\x2e" +
- "\xb0\xb1\x59\xbf\x33\xb0\x37\x1e\x1c\x1b\x4b\xd0\xed\x0f\x21\xf8\xa7\x3c\x1b\x11\x79\x69\xcf\x8f\xf8\x62\x3c\x08" +
- "\xaa\xa4\x20\xd8\xb5\xb2\x6a\x03\x7d\x02\xad\x18\x37\x04\xa8\x05\xec\x68\xe0\xac\x36\x3c\x1e\x8e\x7a\x0f\xa6\x8e" +
- "\x9c\x9b\x88\x2c\x0e\xd7\xb9\x15\x7c\x6e\x91\x61\x87\xfb\x28\x4f\x85\x1a\x4a\x02\x17\x08\x6e\xb4\x1a\x26\x37\xda" +
- "\xec\xc6\xeb\x0e\x54\x8e\xe0\xd6\x38\x5a\x9d\xab\x79\x52\x06\xcf\x95\x7f\x6f\x0e\x59\x04\x2d\x05\xd1\xdc\x43\x96" +
- "\x70\x8f\x98\xe0\xad\x52\x0f\xd8\xb8\xbf\x6a\xa9\xda\x90\x00\x6c\x50\x6a\xc7\x80\xe0\x88\x83\xce\xd6\x2b\x72\xc1" +
- "\x3c\xa4\xa3\x46\xdc\xd2\x1e\x84\x21\x17\xcd\x33\xe6\x69\xe8\x91\x99\xac\x76\xa3\x8a\x3b\xe3\x95\x80\x2e\x18\x54" +
- "\x86\xa6\xd6\xed\xa1\x36\x16\x62\x3c\x63\x17\x8f\x6b\x3c\x39\x37\x4b\x6d\xbf\xc5\x0a\x37\xa8\xe1\x16\x6c\xc8\xbf" +
- "\xe1\x28\x67\xbc\xad\x08\x2a\x23\xe8\x11\x0b\x7c\xac\xa1\x32\xde\x3a\x9a\x5c\xb6\x82\x5b\xfe\xbd\x83\xde\x97\x4a" +
- "\xba\x96\x04\x18\x1d\x5a\x8b\xab\x3b\x89\x64\xfd\x17\xc9\xef\x7d\x19\xda\x06\x60\xd3\x10\xb7\x64\x63\xcf\x0e\x08" +
- "\x4c\x8e\xc1\x79\xc9\x34\xb7\xe4\x89\x13\x1c\xd6\x57\xc6\xc2\x71\x39\x9d\x66\x1e\x21\xf8\x0c\x30\x2b\xc1\x0f\xb8" +
- "\x63\x62\x8e\x9d\x44\xc8\x9e\xf3\xfe\x01\xac\x09\x79\x48\x48\x54\xa6\x59\x2c\xcd\x71\x6b\x3a\x02\x26\xf8\xd8\x5b" +
- "\x5d\xa8\xcc\xc3\x96\xea\xac\x89\x5d\x42\x2d\x26\x9e\xbc\x7d\x3d\x47\xc5\xb7\x56\x78\x7a\x0c\xb2\xe7\x59\xfb\xfa" +
- "\x09\x0d\x57\xa5\xcc\xe1\x69\x21\xa4\xeb\xe4\x91\x49\x16\x5a\xa3\xff\xfe\x67\xb9\x05\x3a\xf5\xc9\x99\x2e\x0b\x99" +
- "\xef\xca\xda\x97\xc7\xe7\x48\xe0\x55\x91\x4c\x61\xf4\x81\x74\xc3\xed\xc7\x3e\xbe\x4a\x8e\x7b\x29\x6b\xd4\xf0\x7c" +
- "\x49\xd6\xd3\x23\x0c\x54\x04\xbf\xc9\xb3\xb8\x70\xde\x15\xc6\xc2\x3a\x18\x47\xfb\xae\x0c\xa5\x74\xa1\xcc\x1e\x2a" +
- "\xe8\x0f\x2f\x86\x60\x59\x94\xe5\x49\x55\xf4\x51\xa5\x2f\xb6\x01\x83\xb4\x31\x97\x95\xe6\x7e\x90\xc7\x3b\xba\xeb" +
- "\xa9\x92\xa8\x26\x59\xe0\x1f\x8e\xc0\x0d\x73\xf1\xd3\x00\x56\x4c\xd6\x9d\x51\x6c\xe1\xae\x6f\x2d\xf9\x3f\xff\x76" +
- "\xf3\x6e\x26\xf6\x59\x4a\xba\xdf\x54\x22\x26\xa4\x3f\xbc\xfa\x31\x4b\x60\xea\xf9\xff\x15\x3f\x1c\x24\xeb\x70\xc0" +
- "\xd0\x39\x3c\xe4\x9a\x93\x97\xcd\xf5\xca\x5e\x11\xcf\x8b\xcd\xcf\x53\x9e\x36\xcb\x9c\x5b\xdf\x04\x3e\x2e\x71\xec" +
- "\xca\xd3\x7b\x2b\x3b\xb4\xfb\xc1\xb0\x26\x5a\xf4\x0e\xb7\x21\x3f\xe0\x36\x54\x3f\xd4\x0d\xb9\x2b\x38\xfc\x78\x16" +
- "\xcd\xb3\xe1\xd3\x4a\x9e\x0d\xdf\xa7\xfe\x17\x00\x00\xff\xff\xf5\xdc\xbb\xb3\xb0\x12\x00\x00")
+ "\x1f\x8b\x08\x00\x00\x00\x00\x00\x00\xff\xbc\x58\xdb\x8e\xdc\xb8\x11\x7d\xf7\x57\xd4\xca\x08\xf2\xb2\x6a\xd9\x6b" +
+ "\x63\xb1\x71\xa4\x0e\x8c\x71\x12\x4f\xe2\x85\x1d\x8c\x03\xc4\x4f\x41\x49\xac\x96\xe8\xa6\x48\x81\x2c\x76\x4f\xe7" +
+ "\x47\xf2\x41\xf9\xb1\x80\xd4\x65\xa4\x6e\x4d\xa6\xbd\x08\xd6\x2f\x23\x93\x87\x64\x5d\x4e\x1d\x16\x3b\xff\xee\xdd" +
+ "\xc7\x9b\xcf\x5f\x3e\xfd\x11\x1a\x6e\xd5\xf6\x59\x1e\xfe\x80\x42\x5d\x17\x09\xe9\x64\xfb\x0c\x20\x6f\x08\x45\xf8" +
+ "\x00\xc8\x5b\x62\x84\xaa\x41\xeb\x88\x8b\xc4\xf3\x2e\xfd\x29\x99\x4f\x69\x6c\xa9\x48\x0e\x92\x8e\x9d\xb1\x9c\x40" +
+ "\x65\x34\x93\xe6\x22\x39\x4a\xc1\x4d\x21\xe8\x20\x2b\x4a\xe3\x7f\xbe\x07\xa9\x25\x4b\x54\xa9\xab\x50\x51\xf1\xf2" +
+ "\x7b\x70\x8d\x95\x7a\x9f\xb2\x49\x77\x92\x0b\x6d\xc6\xad\x59\xb2\xa2\xed\x1d\x55\xde\x12\x7c\x42\xe7\x8e\xc6\x8a" +
+ "\x3c\xeb\x87\x9f\xf5\x98\xef\xd2\x14\x3e\x18\x14\x80\x5d\x07\xae\xb2\xb2\x63\x20\xb4\xea\x04\x6c\xa0\xb3\x74\x20" +
+ "\xcd\x50\x2a\xd4\x7b\x78\xff\xf9\xe7\x0f\x70\x94\xdc\x18\xcf\xe0\xf8\xa4\xa4\xae\x21\x4d\x87\xc3\x86\xb5\xce\x56" +
+ "\x45\x82\xce\x11\xbb\xac\xf4\x5a\x28\xda\x7c\x75\xc9\x36\xcf\xfa\xf9\x18\x98\x6c\x8c\x4c\x5e\x1a\x71\x1a\xd6\x6b" +
+ "\x3c\x40\xa5\xd0\xb9\x22\xd1\x78\x28\xd1\x42\xff\x27\xa5\xfb\x0e\xb5\x48\x55\x3d\x0e\x28\x59\x37\x0c\x65\xdd\x7f" +
+ "\x0c\xce\x02\xe4\xb8\x5c\x9f\x96\x16\xb5\x48\xa0\xb1\xb4\x2b\x92\xe7\xc9\x65\x20\x70\x5a\x5a\x7a\x66\xa3\xcf\xd6" +
+ "\xb3\xa9\x6b\x45\x36\x01\x3e\x75\x54\x24\x3d\x26\x01\x81\x8c\xc3\x5c\x91\x54\x46\x29\xec\x1c\x8d\xc3\x68\xeb\x90" +
+ "\xe1\xe7\xfd\x16\x77\xbe\x0b\xf9\x24\x71\xd3\xe7\x33\x01\xb4\x12\xd3\x90\x5d\x6b\xd4\x74\xd2\x23\xb0\xde\x71\x12" +
+ "\x45\xb2\x43\x15\x8e\x88\xa3\x0a\x4b\x52\x45\xf2\x39\x1a\x10\x42\x22\x6b\x64\x69\xf4\x14\x87\x90\x8b\x0e\x1f\x71" +
+ "\x26\x95\x55\x80\xe6\x59\x80\x4c\xee\x67\xbd\x6f\x03\x27\x00\x72\x21\xa7\x64\x8c\x1e\x8e\xd1\x7f\xf0\x58\x8a\x47" +
+ "\x1d\x98\xd9\xe2\xd5\x99\x25\x21\xd1\xad\x4d\xd1\xb3\x99\xe1\x00\x72\x25\x67\xc8\x54\x32\xb5\x8b\xf9\xb3\x0c\xa7" +
+ "\x4a\xea\xfd\x98\xdd\x86\xb9\x73\x6f\xb2\xac\x96\xdc\xf8\x72\x53\x99\x36\xfb\xe0\xff\x25\x77\x64\xb3\x6e\x48\xf7" +
+ "\xf3\x83\xc4\x14\x3b\x99\x6c\xdf\x7e\xba\x85\x77\xa6\xf2\x2d\x69\x8e\xa1\x9b\x31\xa1\x0f\x87\x92\x33\x07\x32\xaf" +
+ "\xa6\xc0\x3c\xe2\xcf\xb7\xfa\x31\xd0\x6d\xc9\xab\x61\x4d\xc9\x1a\x4a\xd6\xa9\xa0\x1d\x7a\xc5\x63\xd8\x4b\x3e\xa7" +
+ "\x5e\x6b\x04\xaa\x73\xde\x39\x62\x96\xba\x76\x3f\xc7\xc9\xe5\xb1\x00\xf9\x64\xd9\x0e\x1d\xec\x02\x13\xeb\x81\x56" +
+ "\x8d\x14\x82\x74\x91\xb0\xf5\x14\xf8\x21\xb7\x70\x37\xec\xb5\xb4\x7d\xe2\xca\xff\x0e\xd8\xf8\x2d\xe4\x61\x28\xf0" +
+ "\x4c\xe3\x61\x54\x9d\x05\xbf\x34\xa3\xd4\x64\xa1\xe5\xf4\xf5\x43\x35\xcf\x20\xd6\x1c\xe1\xab\x77\x2c\x77\xa7\x74" +
+ "\x50\xc6\xb4\x15\x69\x45\x9a\xc9\xce\xb9\xb6\xa4\x6d\x7a\xef\xd2\x97\x3f\x40\xf8\x72\x6d\xfa\x53\xfc\x68\x45\xfa" +
+ "\x63\x32\x4b\xe7\x72\xd1\x57\xdf\x96\x86\xed\xa2\x98\x22\xa6\x1b\x11\x8a\x50\xc0\xc5\xc1\xfd\xbf\x5b\x38\x4a\xa5" +
+ "\xa0\x26\x4d\x16\x99\x00\x41\xd3\x11\x5c\xaf\x3a\x23\x0d\x81\x0e\x64\x4f\xf0\xea\x45\x98\x30\x5a\xb8\x0d\xfc\xc5" +
+ "\x3b\x86\x4a\xc9\x6a\x0f\xdc\xcc\x90\x6c\x60\x4f\xd4\xc5\xc1\xca\x5b\x1b\x94\xd8\x68\xda\xc0\x59\x42\xba\x65\x2e" +
+ "\x62\xc4\x1f\x71\xb0\x42\x2b\xa0\x2d\xd3\x57\xe7\x0e\x9e\x61\xd2\xa0\xd0\x2b\x2e\x7e\x31\xde\x4e\x06\x9e\x99\x31" +
+ "\x65\xfa\xd1\x4d\x83\xda\x5f\x72\x72\x86\xda\x19\xdb\xa6\xb5\x35\xbe\xbb\x80\x05\xf2\xea\xce\xf3\x02\x3a\x08\xe9" +
+ "\x98\x90\xa8\x48\x3b\x53\x79\x47\xe2\x36\x80\x47\xe9\x66\xba\xe7\x04\x0e\xa8\x3c\x15\xc9\x66\xb3\xb9\x34\x62\xc5" +
+ "\xfa\x2b\x1c\xda\x19\xb3\x46\x84\x39\xae\xb3\xa6\xb6\xe4\xdc\x9a\x43\x2b\xb0\xb4\x44\x9b\xc4\xcb\x95\x86\xcb\xff" +
+ "\x0d\xbc\x7c\xf1\xe2\x37\xbf\x0f\x35\x79\x61\xd0\x75\x86\x3f\x4d\x89\x5f\xc8\x86\x3f\xbd\xfd\xdb\xff\x89\x03\x0f" +
+ "\x8a\x31\x1b\x54\x72\x9b\xbb\x50\x8d\xf5\xf6\x9d\x81\x93\xf1\xe0\xd8\x58\x82\xf6\x34\x51\xf0\x0f\x79\x36\x20\xf2" +
+ "\xd2\x5e\x6e\xf1\xc5\x78\x10\x54\x49\x41\x70\x6c\x64\xd5\x84\xf2\x09\x65\xc5\xb8\x27\x40\x2d\xe0\x48\x7d\xcd\x6a" +
+ "\xc3\xc3\xe6\xa8\x4f\x60\x76\xb1\xe6\xc6\x42\x16\xd3\x71\x6e\x03\x9f\x1b\x64\x38\xe2\x29\xda\x53\xa1\x86\x92\xc0" +
+ "\x85\x02\x37\x5a\xf5\x83\x7b\x6d\x8e\xc3\x71\x53\x29\x47\x70\x63\x1c\x6d\x2e\xdd\x5c\x88\xe7\x9a\xf3\xef\xcd\xa4" +
+ "\x22\x68\x29\x98\xe6\x1e\x54\xc2\x3d\x11\x82\xb7\x4a\x3d\x60\xe3\xfa\xaa\xa1\x6a\x4f\x02\xb0\x46\xa9\x1d\x03\x82" +
+ "\x23\x0e\x3e\x5b\xaf\xc8\x85\xf0\x90\x8e\x1e\x71\x43\x27\x10\x86\x5c\x0c\xcf\xa0\xd3\xd0\x21\x33\x59\xed\x06\x17" +
+ "\x8f\xc6\x2b\x01\x6d\x08\xa8\x0c\x9d\xa3\x3b\xc1\xce\x58\x88\x7c\xc6\x36\x6e\x57\x7b\x72\x6e\x21\x6d\xbf\x24\x0a" +
+ "\x37\xa8\xe1\x16\x6c\xd0\xdf\xb0\x95\x33\xde\x56\x04\x95\x11\xf4\x44\x04\x3e\xee\xa0\x32\xde\x3a\x1a\x53\xb6\x81" +
+ "\x5b\xfe\xad\x83\xce\x97\x4a\xba\x86\x04\x18\x1d\x5a\x8b\xab\x3b\x89\x64\xfb\x67\xc9\xef\x7d\x19\xda\x06\x60\x53" +
+ "\x13\x37\x64\x63\x63\x0c\x08\x4c\x8e\xc1\x79\xc9\xb4\x8c\xe4\x59\x12\x1c\xee\xae\xe4\xc2\xfc\x3a\x1d\x47\x9e\x28" +
+ "\xf0\x05\x60\x71\x05\x3f\xe0\xe6\x85\x39\x74\x12\x41\x3d\x97\xfd\x03\x58\x13\x74\x48\x48\x54\xa6\x5e\xbd\x9a\xe3" +
+ "\xd2\x74\x00\x8c\xf0\xa1\xb7\x7a\xe4\x66\xee\x97\x54\x17\x9d\xe2\x1a\x6a\x55\x78\xf2\xe6\xf5\x12\x15\x1f\x34\xa1" +
+ "\xbf\xef\x6d\xcf\xb3\xe6\xf5\x37\x34\x5c\x95\x32\x53\xff\x2e\xa4\x6b\xe5\x2c\x24\x2b\xad\xd1\x7f\xfe\xbd\xde\x02" +
+ "\x9d\xe7\xe4\xc2\x97\x15\xe5\xbb\xf2\xee\xcb\x63\xcf\x1f\xea\xaa\x48\x46\x1a\x7d\x20\x5d\x73\xf3\xb1\x8b\xad\xff" +
+ "\xbc\x97\xb2\x46\xf5\x6f\x84\x64\x3b\xbe\x74\x40\x45\xf0\x9b\x3c\x8b\x13\x97\x5d\x61\xbc\x58\xfb\xe0\x68\xdf\x96" +
+ "\xe1\x2a\x5d\xb9\x66\xa7\x1b\xf4\x87\x17\x3d\x59\x56\x6d\xf9\xa6\x5b\xf4\x49\xa7\x1f\x6d\x03\x7a\x6b\xa3\x96\x95" +
+ "\xe6\xbe\xb7\xc7\x3b\xba\xeb\xa8\x92\xa8\x46\x5b\xe0\xef\x8e\xc0\xf5\x63\xf1\xfd\x8d\x15\x93\x75\x17\x25\xb6\x72" +
+ "\xd6\xaf\x6d\xf9\x3f\xfe\x7a\xf3\x6e\x61\xf6\x85\x24\xdd\xef\x2b\x11\x05\xe9\x77\xaf\x7e\xcc\x12\x18\x7b\xfe\x7f" +
+ "\xc6\xd7\x79\xb2\x0d\x1b\xf4\x9d\xc3\x83\xd6\x9c\xbd\x6c\xae\x77\xf6\x0a\x3e\xaf\x36\x3f\xdf\xf2\xb4\x59\xaf\xb9" +
+ "\xed\x4d\xa8\xc7\xb5\x1a\xbb\x72\xf7\xce\xca\x16\xed\xa9\x0f\xac\x89\x11\xbd\xc3\x43\xd0\x07\x3c\x84\xdb\x0f\x75" +
+ "\x4d\xee\x8a\x1a\x7e\x5a\x45\xf3\xac\xff\xfd\x22\xcf\xfa\x1f\x81\xfe\x1b\x00\x00\xff\xff\x46\x6e\x97\x23\x15\x12" +
+ "\x00\x00")
func bindataFrontendIndexhtmlBytes() ([]byte, error) {
return bindataRead(
@@ -20265,7 +20265,7 @@ func bindataFrontendIndexhtml() (*asset, error) {
info := bindataFileInfo{
name: "frontend/index.html",
- size: 4784,
+ size: 4629,
md5checksum: "",
mode: os.FileMode(420),
modTime: time.Unix(1, 0),
diff --git a/cmdGet.go b/cmd/password/cmdGet.go
similarity index 100%
rename from cmdGet.go
rename to cmd/password/cmdGet.go
diff --git a/cmdServe.go b/cmd/password/cmdServe.go
similarity index 100%
rename from cmdServe.go
rename to cmd/password/cmdServe.go
diff --git a/cmdVersion.go b/cmd/password/cmdVersion.go
similarity index 100%
rename from cmdVersion.go
rename to cmd/password/cmdVersion.go
diff --git a/flags.go b/cmd/password/flags.go
similarity index 100%
rename from flags.go
rename to cmd/password/flags.go
diff --git a/cmd/password/go.mod b/cmd/password/go.mod
new file mode 100644
index 0000000..0786e65
--- /dev/null
+++ b/cmd/password/go.mod
@@ -0,0 +1,14 @@
+module github.com/Luzifer/password/cmd/password
+
+go 1.12
+
+require (
+ github.com/Luzifer/go_helpers v2.8.1+incompatible
+ github.com/Luzifer/password v1.13.1
+ github.com/gorilla/mux v1.7.0
+ github.com/pkg/errors v0.8.1 // indirect
+ github.com/spf13/cobra v0.0.3
+ github.com/spf13/pflag v1.0.3 // indirect
+ github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c // indirect
+ golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25 // indirect
+)
diff --git a/cmd/password/go.sum b/cmd/password/go.sum
new file mode 100644
index 0000000..cfc1059
--- /dev/null
+++ b/cmd/password/go.sum
@@ -0,0 +1,17 @@
+github.com/Luzifer/go_helpers v2.8.1+incompatible h1:9YvrAn7pU2viK5vRpAnI+0gyz+Tw8rxWHVIYHi642zk=
+github.com/Luzifer/go_helpers v2.8.1+incompatible/go.mod h1:5yUSe0FS7lIx1Uzmt0R3tdPFrSSaPfiCqaIA6u0Zn4Y=
+github.com/Luzifer/password v1.13.1 h1:peyCOEtIF7bmApaKM9ahJ4+BbN9ZZgzj+19A7aO6988=
+github.com/Luzifer/password v1.13.1/go.mod h1:F8bbXgwczd/1vyyJ9G8Z6hPvaqtpKR9VZM0E7jkZKJc=
+github.com/gorilla/mux v1.7.0 h1:tOSd0UKHQd6urX6ApfOn4XdBMY6Sh1MfxV3kmaazO+U=
+github.com/gorilla/mux v1.7.0/go.mod h1:1lud6UwP+6orDFRuTfBEV8e9/aOM/c4fVVCaMa2zaAs=
+github.com/pkg/errors v0.8.1 h1:iURUrRGxPUNPdy5/HRSm+Yj6okJ6UtLINN0Q9M4+h3I=
+github.com/pkg/errors v0.8.1/go.mod h1:bwawxfHBFNV+L2hUp1rHADufV3IMtnDRdf1r5NINEl0=
+github.com/spf13/cobra v0.0.3 h1:ZlrZ4XsMRm04Fr5pSFxBgfND2EBVa1nLpiy1stUsX/8=
+github.com/spf13/cobra v0.0.3/go.mod h1:1l0Ry5zgKvJasoi3XT1TypsSe7PqH0Sj9dhYf7v3XqQ=
+github.com/spf13/pflag v1.0.3 h1:zPAT6CGy6wXeQ7NtTnaTerfKOsV6V6F8agHXFiazDkg=
+github.com/spf13/pflag v1.0.3/go.mod h1:DYY7MBk1bdzusC3SYhjObp+wFpr4gzcvqqNjLnInEg4=
+github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c h1:5q7IHeqvAA4hWR1CfpTOS7RFsTDC36TaSZ8Dvc00bPk=
+github.com/tredoe/osutil v0.0.0-20161130133508-7d3ee1afa71c/go.mod h1:M/I710pXKQToMdqt/D+mJ4QsnW6WDaajyB6DWFmDXBs=
+golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25 h1:jsG6UpNLt9iAsb0S2AGW28DveNzzgmbXR+ENoPjUeIU=
+golang.org/x/crypto v0.0.0-20190228161510-8dd112bcdc25/go.mod h1:djNgcEr1/C05ACkg1iLfiJU5Ep61QUkGW8qpdssI0+w=
+golang.org/x/sys v0.0.0-20190215142949-d0b11bdaac8a/go.mod h1:STP8DvDyc/dI5b8T5hshtkjS+E42TnysNCUPdjciGhY=
diff --git a/main.go b/cmd/password/main.go
similarity index 100%
rename from main.go
rename to cmd/password/main.go
diff --git a/frontend/index.html b/frontend/index.html
index 5d1d6f8..d32d7c3 100644
--- a/frontend/index.html
+++ b/frontend/index.html
@@ -17,9 +17,6 @@
- -
- Alfred Extension
-
-
API Documentation
diff --git a/generateXKCDWordList.sh b/generateXKCDWordList.sh
index 8df30ee..07d4aab 100644
--- a/generateXKCDWordList.sh
+++ b/generateXKCDWordList.sh
@@ -1,10 +1,10 @@
#!/bin/bash
set -euo pipefail
-version="8744120d"
-source="https://raw.githubusercontent.com/leonardr/olipy/${version}/data/more-corpora/scribblenauts_words.txt"
+version="19af63af"
+source="https://raw.githubusercontent.com/leonardr/olipy/${version}/olipy/data/corpora-olipy/words/scribblenauts.json"
-words=$(curl -sL "${source}" | awk '/^[a-z]{4}[a-z]*$/{ print "\""$1"\"," }')
+words=$(curl -sL "${source}" | jq -r '.nouns | .[]' | sort | awk '/^[a-z]{4}[a-z]*$/{ print "\""$1"\"," }')
cat -s <lib/xkcd_words.go
package securepassword
diff --git a/lib/go.mod b/lib/go.mod
new file mode 100644
index 0000000..8d19e73
--- /dev/null
+++ b/lib/go.mod
@@ -0,0 +1,8 @@
+module github.com/Luzifer/password/lib/v2
+
+go 1.12
+
+require (
+ github.com/Luzifer/go_helpers/v2 v2.9.0
+ github.com/pkg/errors v0.8.1
+)
diff --git a/lib/xkcd.go b/lib/xkcd.go
index ebb91cb..ec6178d 100644
--- a/lib/xkcd.go
+++ b/lib/xkcd.go
@@ -6,7 +6,7 @@ import (
"strings"
"time"
- "github.com/Luzifer/go_helpers/str"
+ "github.com/Luzifer/go_helpers/v2/str"
)
type XKCD struct{}
diff --git a/lib/xkcd_words.go b/lib/xkcd_words.go
index cba8d9b..ca7dfe2 100644
--- a/lib/xkcd_words.go
+++ b/lib/xkcd_words.go
@@ -4,3885 +4,3885 @@ package securepassword
// word list inside the olipy library by leonardr
// https://github.com/leonardr/olipy
var xkcdWordList = []string{
- "world",
- "hand",
- "room",
- "face",
- "thing",
- "door",
- "woman",
- "house",
- "money",
- "father",
- "mother",
- "water",
- "city",
- "school",
- "office",
- "body",
- "wife",
- "home",
- "company",
- "table",
- "death",
- "hair",
- "light",
- "word",
- "food",
- "floor",
- "book",
- "story",
- "heart",
- "friend",
- "town",
- "land",
- "game",
- "matter",
- "window",
- "blood",
- "wall",
- "street",
- "husband",
- "fire",
- "mouth",
- "building",
- "road",
- "paper",
- "court",
- "space",
- "form",
- "market",
- "chair",
- "television",
- "president",
- "field",
- "glass",
- "phone",
- "plan",
- "change",
- "letter",
- "level",
- "evidence",
- "smile",
- "support",
- "show",
- "community",
- "brother",
- "picture",
- "kitchen",
- "press",
- "study",
- "daughter",
- "director",
- "dinner",
- "record",
- "desk",
- "stage",
- "earth",
- "board",
- "security",
- "horse",
- "church",
- "bill",
- "river",
- "coffee",
- "wind",
- "bank",
- "corner",
- "help",
- "answer",
- "hospital",
- "film",
- "apartment",
- "ship",
- "seat",
- "gold",
- "leader",
- "doctor",
- "figure",
- "telephone",
- "station",
- "growth",
- "foot",
- "radio",
- "sign",
- "capital",
- "neck",
- "college",
- "skin",
- "plane",
- "audience",
- "movie",
- "hotel",
- "stone",
- "army",
- "chairman",
- "computer",
- "science",
- "spring",
- "machine",
- "material",
- "image",
- "surface",
- "officer",
- "page",
- "suit",
- "lady",
- "stock",
- "list",
- "farm",
- "student",
- "ball",
- "nose",
- "plant",
- "wood",
- "chest",
- "message",
- "stuff",
- "sister",
- "drink",
- "store",
- "character",
- "boat",
- "animal",
- "rock",
- "weight",
- "disease",
- "spirit",
- "king",
- "lawyer",
- "train",
- "executive",
- "rain",
- "prison",
- "shirt",
- "lunch",
- "snow",
- "range",
- "agency",
- "village",
- "bottle",
- "enemy",
- "newspaper",
- "victory",
- "dress",
- "degree",
- "pocket",
- "manager",
- "brain",
- "driver",
- "coat",
- "shot",
- "metal",
- "official",
- "truck",
- "note",
- "chief",
- "grass",
- "contract",
- "soul",
- "bedroom",
- "magazine",
- "model",
- "writer",
- "song",
- "patient",
- "club",
- "quarter",
- "pattern",
- "date",
- "finger",
- "teacher",
- "article",
- "flesh",
- "island",
- "technology",
- "crew",
- "object",
- "guard",
- "shop",
- "knife",
- "star",
- "agent",
- "milk",
- "judge",
- "silver",
- "region",
- "steel",
- "sugar",
- "hole",
- "supply",
- "jacket",
- "jury",
- "secretary",
- "mountain",
- "master",
- "artist",
- "track",
- "captain",
- "university",
- "smoke",
- "mirror",
- "plastic",
- "garden",
- "dust",
- "watch",
- "lead",
- "solution",
- "measure",
- "mission",
- "goal",
- "tongue",
- "moon",
- "author",
- "iron",
- "breakfast",
- "cover",
- "environment",
- "fuel",
- "hill",
- "shock",
- "band",
- "contact",
- "engine",
- "restaurant",
- "estate",
- "camera",
- "beach",
- "post",
- "pool",
- "football",
- "roof",
- "forest",
- "entrance",
- "bird",
- "tape",
- "card",
- "ring",
- "wheel",
- "passage",
- "bridge",
- "novel",
- "gift",
- "professor",
- "bathroom",
- "plate",
- "district",
- "park",
- "wave",
- "player",
- "present",
- "theater",
- "atmosphere",
- "leather",
- "painting",
- "neighborhood",
- "block",
- "priest",
- "editor",
- "target",
- "gate",
- "baseball",
- "airport",
- "shadow",
- "attorney",
- "doorway",
- "consumer",
- "general",
- "being",
- "partner",
- "chain",
- "weapon",
- "coal",
- "meal",
- "library",
- "mail",
- "drive",
- "fellow",
- "soldier",
- "soil",
- "literature",
- "pilot",
- "dance",
- "scale",
- "desert",
- "poet",
- "cabin",
- "corn",
- "check",
- "yard",
- "hero",
- "fool",
- "package",
- "platform",
- "nurse",
- "stream",
- "medicine",
- "grain",
- "planet",
- "chicken",
- "storm",
- "creature",
- "stand",
- "lake",
- "corridor",
- "reporter",
- "belt",
- "jail",
- "mayor",
- "highway",
- "wire",
- "rifle",
- "frame",
- "ticket",
- "coach",
- "valley",
- "minister",
- "deck",
- "territory",
- "universe",
- "counter",
- "cell",
- "governor",
- "salt",
- "elevator",
- "porch",
- "sheet",
- "cloth",
- "actor",
- "bomb",
- "bench",
- "break",
- "branch",
- "factory",
- "fence",
- "lobby",
- "bone",
- "route",
- "ocean",
- "signal",
- "bear",
- "sword",
- "cream",
- "panel",
- "grandfather",
- "couch",
- "engineer",
- "wagon",
- "waste",
- "chamber",
- "commander",
- "clock",
- "establishment",
- "flag",
- "pack",
- "beard",
- "honey",
- "stick",
- "device",
- "cloud",
- "display",
- "uniform",
- "gasoline",
- "tail",
- "blanket",
- "mess",
- "drop",
- "belly",
- "port",
- "pipe",
- "heaven",
- "worker",
- "file",
- "flat",
- "uncle",
- "customer",
- "radiation",
- "studio",
- "boss",
- "tent",
- "poem",
- "clerk",
- "match",
- "column",
- "cousin",
- "host",
- "wheat",
- "silk",
- "aide",
- "rope",
- "instrument",
- "string",
- "adult",
- "sweat",
- "lover",
- "faculty",
- "farmer",
- "missile",
- "grin",
- "tank",
- "square",
- "laboratory",
- "palm",
- "tower",
- "deputy",
- "institution",
- "magic",
- "standard",
- "grandmother",
- "bowl",
- "closet",
- "genius",
- "citizen",
- "button",
- "pistol",
- "assistant",
- "alarm",
- "fist",
- "bell",
- "rose",
- "score",
- "crop",
- "vehicle",
- "barn",
- "shift",
- "license",
- "pollution",
- "bath",
- "producer",
- "cotton",
- "muscle",
- "cycle",
- "steam",
- "palace",
- "beef",
- "policeman",
- "tube",
- "blade",
- "lord",
- "shade",
- "acid",
- "jungle",
- "railroad",
- "soup",
- "sofa",
- "gear",
- "robe",
- "speaker",
- "embassy",
- "invitation",
- "barrel",
- "garage",
- "collar",
- "trunk",
- "paint",
- "stove",
- "grave",
- "notice",
- "museum",
- "graduate",
- "sidewalk",
- "taxi",
- "lamp",
- "photograph",
- "tray",
- "flower",
- "shower",
- "castle",
- "cross",
- "booth",
- "lawn",
- "publication",
- "wrist",
- "skirt",
- "servant",
- "prisoner",
- "physician",
- "neighbor",
- "elbow",
- "cave",
- "basketball",
- "juice",
- "brick",
- "envelope",
- "glory",
- "politician",
- "rail",
- "parent",
- "stake",
- "curtain",
- "infant",
- "count",
- "lock",
- "entertainment",
- "shuttle",
- "companion",
- "aunt",
- "shelter",
- "tool",
- "peak",
- "cage",
- "well",
- "flame",
- "text",
- "automobile",
- "scientist",
- "cake",
- "brush",
- "basement",
- "document",
- "marble",
- "pitch",
- "guide",
- "bureau",
- "queen",
- "brass",
- "zone",
- "skull",
- "cable",
- "corporation",
- "foundation",
- "countryside",
- "monster",
- "killer",
- "mask",
- "breeze",
- "whiskey",
- "basket",
- "tissue",
- "satellite",
- "motor",
- "portrait",
- "drawer",
- "analyst",
- "economist",
- "visitor",
- "slope",
- "sheriff",
- "tunnel",
- "devil",
- "throne",
- "hook",
- "temple",
- "handle",
- "shoe",
- "helicopter",
- "gown",
- "hallway",
- "subway",
- "drawing",
- "cabinet",
- "wilderness",
- "towel",
- "sink",
- "detective",
- "critic",
- "dish",
- "hack",
- "photo",
- "crown",
- "operator",
- "bull",
- "alley",
- "male",
- "plain",
- "pillow",
- "beast",
- "seed",
- "guerrilla",
- "straw",
- "snake",
- "roll",
- "horn",
- "mate",
- "resort",
- "apple",
- "bullet",
- "saddle",
- "suitcase",
- "protein",
- "cook",
- "toilet",
- "ranch",
- "representative",
- "shell",
- "prince",
- "video",
- "clay",
- "actress",
- "pencil",
- "shelf",
- "waiter",
- "charm",
- "wool",
- "sweater",
- "soap",
- "widow",
- "sergeant",
- "sauce",
- "painter",
- "fabric",
- "carrier",
- "ladder",
- "cottage",
- "opponent",
- "dealer",
- "spread",
- "beam",
- "harbor",
- "gallery",
- "prize",
- "fireplace",
- "fighter",
- "prosecutor",
- "root",
- "transport",
- "link",
- "diplomat",
- "flood",
- "architect",
- "peasant",
- "female",
- "carpet",
- "facility",
- "transfer",
- "powder",
- "parlor",
- "pine",
- "senator",
- "cart",
- "trap",
- "corpse",
- "emperor",
- "patch",
- "barrier",
- "ambassador",
- "carriage",
- "residence",
- "maid",
- "switch",
- "lieutenant",
- "cliff",
- "lightning",
- "mist",
- "salad",
- "flour",
- "continent",
- "poison",
- "radar",
- "outfit",
- "journalist",
- "businessman",
- "singer",
- "scope",
- "warrior",
- "cast",
- "observer",
- "thread",
- "organ",
- "needle",
- "revolver",
- "candy",
- "classroom",
- "bride",
- "vitamin",
- "refrigerator",
- "sandwich",
- "defendant",
- "angel",
- "compartment",
- "vegetable",
- "treasure",
- "salesman",
- "clinic",
- "layer",
- "pitcher",
- "publisher",
- "suite",
- "airplane",
- "hammer",
- "reward",
- "pole",
- "rocket",
- "aisle",
- "vessel",
- "penalty",
- "orange",
- "consultant",
- "liver",
- "leaf",
- "designer",
- "velvet",
- "bush",
- "cloak",
- "copper",
- "orchestra",
- "chocolate",
- "circuit",
- "feed",
- "courtyard",
- "retreat",
- "historian",
- "theatre",
- "bucket",
- "mill",
- "psychiatrist",
- "swing",
- "ghost",
- "channel",
- "dock",
- "statue",
- "doll",
- "mistress",
- "oven",
- "scent",
- "restraint",
- "twin",
- "diamond",
- "lion",
- "cord",
- "wallet",
- "stool",
- "banker",
- "colonel",
- "ally",
- "sleeve",
- "coin",
- "album",
- "laundry",
- "handkerchief",
- "candle",
- "terminal",
- "elephant",
- "manufacturer",
- "locker",
- "pulse",
- "giant",
- "navy",
- "photographer",
- "cowboy",
- "bishop",
- "linen",
- "junk",
- "dragon",
- "ruler",
- "costume",
- "mansion",
- "hood",
- "cellar",
- "driveway",
- "ambulance",
- "guitar",
- "journal",
- "sculpture",
- "balcony",
- "toast",
- "chart",
- "motel",
- "sadness",
- "scholar",
- "submarine",
- "carbon",
- "thunder",
- "canal",
- "merchant",
- "bolt",
- "wolf",
- "shed",
- "arrow",
- "lodge",
- "bicycle",
- "spine",
- "military",
- "lamb",
- "pond",
- "feast",
- "fluid",
- "altar",
- "recipe",
- "sack",
- "trailer",
- "notebook",
- "surgeon",
- "slip",
- "festival",
- "clearing",
- "rack",
- "flashlight",
- "bundle",
- "murderer",
- "liquid",
- "essay",
- "helmet",
- "correspondent",
- "dressing",
- "dancer",
- "pork",
- "colleague",
- "crystal",
- "lane",
- "chapel",
- "turkey",
- "canoe",
- "sailor",
- "arena",
- "refuge",
- "thesis",
- "waitress",
- "briefcase",
- "commissioner",
- "stack",
- "lift",
- "cane",
- "thief",
- "troop",
- "menu",
- "lounge",
- "administrator",
- "drum",
- "bronze",
- "staircase",
- "whistle",
- "canyon",
- "shotgun",
- "suspect",
- "dome",
- "globe",
- "runway",
- "resident",
- "cemetery",
- "passport",
- "cement",
- "creek",
- "nephew",
- "buddy",
- "lung",
- "typewriter",
- "tribute",
- "hostage",
- "underwear",
- "nest",
- "recorder",
- "potato",
- "ramp",
- "fork",
- "idiot",
- "prey",
- "ivory",
- "robot",
- "seal",
- "haven",
- "bike",
- "synagogue",
- "calendar",
- "lace",
- "timber",
- "tooth",
- "perfume",
- "veteran",
- "lemon",
- "tomb",
- "ammunition",
- "spear",
- "hunter",
- "pump",
- "slide",
- "award",
- "battery",
- "ankle",
- "pepper",
- "cathedral",
- "calf",
- "monkey",
- "suburb",
- "rabbit",
- "boot",
- "pipeline",
- "armor",
- "sphere",
- "moisture",
- "kidney",
- "broker",
- "hose",
- "mound",
- "goat",
- "conductor",
- "terrace",
- "principal",
- "steak",
- "novelist",
- "criminal",
- "intellectual",
- "conservative",
- "quarterback",
- "collector",
- "motorcycle",
- "refugee",
- "punch",
- "clown",
- "preacher",
- "spectacle",
- "apron",
- "banner",
- "attendant",
- "dairy",
- "umbrella",
- "container",
- "merit",
- "reactor",
- "shield",
- "bamboo",
- "runner",
- "garment",
- "railing",
- "rival",
- "supermarket",
- "twilight",
- "bacon",
- "scarf",
- "dime",
- "coffin",
- "rider",
- "philosopher",
- "superintendent",
- "pill",
- "housewife",
- "final",
- "demon",
- "mattress",
- "litter",
- "nail",
- "basin",
- "fiber",
- "whip",
- "microphone",
- "supervisor",
- "stadium",
- "limousine",
- "knot",
- "nursery",
- "freshman",
- "rebel",
- "tile",
- "torch",
- "fountain",
- "crest",
- "princess",
- "greenhouse",
- "messenger",
- "mineral",
- "baggage",
- "mouse",
- "tiger",
- "paradise",
- "hull",
- "glue",
- "composer",
- "ditch",
- "pony",
- "rental",
- "athlete",
- "warehouse",
- "organism",
- "soda",
- "span",
- "counselor",
- "grandson",
- "banana",
- "stamp",
- "anchor",
- "diary",
- "tunic",
- "meadow",
- "backyard",
- "disc",
- "glove",
- "pasture",
- "catalogue",
- "inspector",
- "missionary",
- "sail",
- "chemical",
- "atom",
- "bartender",
- "shark",
- "monument",
- "tomato",
- "plague",
- "fortress",
- "ribbon",
- "drill",
- "sweetheart",
- "laser",
- "sanctuary",
- "poster",
- "marketplace",
- "girlfriend",
- "researcher",
- "yacht",
- "offering",
- "instructor",
- "puzzle",
- "monastery",
- "flock",
- "choir",
- "medal",
- "meter",
- "auditorium",
- "fairy",
- "mare",
- "razor",
- "whale",
- "landlord",
- "stem",
- "drain",
- "spoon",
- "associate",
- "bark",
- "activist",
- "liar",
- "tract",
- "pizza",
- "hollow",
- "admiral",
- "psychologist",
- "musician",
- "puppet",
- "nitrogen",
- "contractor",
- "poker",
- "arch",
- "tractor",
- "buffalo",
- "pier",
- "veil",
- "courthouse",
- "academy",
- "technician",
- "bachelor",
- "lobster",
- "monitor",
- "traveler",
- "investigator",
- "attic",
- "rabbi",
- "knight",
- "innovation",
- "probe",
- "raft",
- "boyfriend",
- "plaza",
- "witch",
- "physicist",
- "prophet",
- "plaster",
- "dentist",
- "telescope",
- "vault",
- "parish",
- "balloon",
- "wheelchair",
- "vest",
- "hatch",
- "sketch",
- "violin",
- "trader",
- "stall",
- "limb",
- "produce",
- "tumor",
- "camel",
- "insect",
- "chauffeur",
- "capsule",
- "dessert",
- "petition",
- "ruin",
- "celebrity",
- "canopy",
- "vaccine",
- "fort",
- "stereo",
- "hearth",
- "avenue",
- "guardian",
- "portfolio",
- "chaplain",
- "wardrobe",
- "cradle",
- "hamburger",
- "advocate",
- "granite",
- "foam",
- "major",
- "folder",
- "nickel",
- "shack",
- "teaspoon",
- "remedy",
- "foreman",
- "seller",
- "columnist",
- "goose",
- "feather",
- "bulb",
- "bomber",
- "overcoat",
- "maze",
- "harp",
- "stew",
- "particle",
- "garlic",
- "scalp",
- "bladder",
- "monk",
- "tweed",
- "loser",
- "shrug",
- "disguise",
- "hostess",
- "workshop",
- "niece",
- "grove",
- "decoration",
- "stain",
- "cape",
- "bubble",
- "asylum",
- "badge",
- "armchair",
- "spark",
- "onion",
- "rubber",
- "bait",
- "dump",
- "perimeter",
- "alien",
- "decree",
- "hobby",
- "dough",
- "lantern",
- "cherry",
- "millionaire",
- "raincoat",
- "skeleton",
- "plantation",
- "spotlight",
- "villa",
- "podium",
- "loft",
- "tyrant",
- "lighter",
- "screw",
- "eagle",
- "napkin",
- "mall",
- "dresser",
- "slate",
- "sulfur",
- "memorial",
- "electron",
- "shrine",
- "mold",
- "astronaut",
- "diesel",
- "neon",
- "heroine",
- "stewardess",
- "adversary",
- "virgin",
- "stairway",
- "supporter",
- "throw",
- "lumber",
- "galaxy",
- "racket",
- "foliage",
- "mechanic",
- "chef",
- "void",
- "mule",
- "pastor",
- "steward",
- "franchise",
- "intercom",
- "prairie",
- "undergraduate",
- "chimney",
- "cereal",
- "packet",
- "microscope",
- "sausage",
- "shrimp",
- "ecstasy",
- "eyebrow",
- "builder",
- "precinct",
- "anthropologist",
- "loaf",
- "dwelling",
- "paperback",
- "paste",
- "shovel",
- "ferry",
- "joint",
- "spit",
- "puff",
- "quilt",
- "playwright",
- "spouse",
- "assassin",
- "cabbage",
- "console",
- "carpenter",
- "lipstick",
- "mahogany",
- "furnace",
- "certificate",
- "pupil",
- "tenor",
- "foyer",
- "bluff",
- "whisky",
- "pouch",
- "babe",
- "pianist",
- "brake",
- "shake",
- "cock",
- "fisherman",
- "shawl",
- "kettle",
- "outlet",
- "chalk",
- "plywood",
- "doorbell",
- "keyboard",
- "peanut",
- "compass",
- "lettuce",
- "harness",
- "abdomen",
- "scout",
- "barber",
- "plateau",
- "hedge",
- "dictator",
- "housekeeper",
- "cafeteria",
- "bard",
- "bathrobe",
- "gauge",
- "spider",
- "reservoir",
- "crib",
- "traitor",
- "kitten",
- "dagger",
- "goddess",
- "fertilizer",
- "punk",
- "crust",
- "nightgown",
- "freak",
- "stump",
- "microwave",
- "lever",
- "playground",
- "dial",
- "playgroup",
- "transmitter",
- "jewel",
- "competitor",
- "butterfly",
- "comb",
- "carving",
- "clip",
- "necklace",
- "axis",
- "porcelain",
- "muzzle",
- "textile",
- "tailor",
- "wizard",
- "cupboard",
- "holster",
- "broom",
- "receptionist",
- "flicker",
- "exam",
- "treasury",
- "roast",
- "trifle",
- "jerk",
- "permit",
- "gene",
- "trainer",
- "doorman",
- "cushion",
- "triangle",
- "apprentice",
- "gorge",
- "frog",
- "hawk",
- "trench",
- "dictionary",
- "crow",
- "flannel",
- "jockey",
- "papa",
- "cone",
- "organizer",
- "fraternity",
- "cubicle",
- "partition",
- "aerial",
- "cinema",
- "carton",
- "chariot",
- "nylon",
- "bathtub",
- "vapor",
- "mailbox",
- "moss",
- "shepherd",
- "textbook",
- "reef",
- "intruder",
- "royalty",
- "developer",
- "plaid",
- "believer",
- "galley",
- "sophomore",
- "clump",
- "mast",
- "generator",
- "mount",
- "worm",
- "catcher",
- "interpreter",
- "graveyard",
- "mane",
- "vase",
- "token",
- "maple",
- "magician",
- "bust",
- "syrup",
- "cassette",
- "pick",
- "madman",
- "cleaner",
- "villain",
- "wallpaper",
- "lime",
- "polish",
- "accountant",
- "dwarf",
- "amateur",
- "donkey",
- "ballroom",
- "popcorn",
- "crook",
- "coral",
- "fragrance",
- "spectator",
- "groom",
- "rattle",
- "skipper",
- "siren",
- "savage",
- "flute",
- "civilian",
- "flask",
- "therapist",
- "plug",
- "weed",
- "patio",
- "residue",
- "passageway",
- "chopper",
- "depot",
- "quarry",
- "hound",
- "wedge",
- "indicator",
- "grotto",
- "blizzard",
- "crab",
- "ration",
- "puck",
- "manual",
- "volcano",
- "crate",
- "rocker",
- "rainbow",
- "informant",
- "freezer",
- "limestone",
- "valve",
- "manure",
- "pail",
- "cardinal",
- "grape",
- "miner",
- "pamphlet",
- "plaque",
- "chat",
- "pulpit",
- "platter",
- "molecule",
- "pyramid",
- "vinegar",
- "acreage",
- "chick",
- "orphan",
- "porter",
- "saucer",
- "antenna",
- "trophy",
- "convent",
- "veal",
- "contender",
- "grenade",
- "boulder",
- "treasurer",
- "cookie",
- "freeway",
- "pillar",
- "carcass",
- "pottery",
- "dormitory",
- "bean",
- "buzzer",
- "jack",
- "marshal",
- "lance",
- "gardener",
- "pearl",
- "ravine",
- "stretcher",
- "trolley",
- "bracelet",
- "plank",
- "jelly",
- "foil",
- "knack",
- "sedan",
- "marsh",
- "ingredient",
- "crater",
- "pigeon",
- "granddaughter",
- "sociologist",
- "locomotive",
- "bookstore",
- "hippie",
- "dugout",
- "trumpet",
- "directory",
- "comrade",
- "turtle",
- "spur",
- "comet",
- "dummy",
- "moustache",
- "mantle",
- "buffet",
- "clutch",
- "courier",
- "hangar",
- "curator",
- "projector",
- "parcel",
- "lure",
- "squash",
- "commentator",
- "mentor",
- "stint",
- "treat",
- "germ",
- "infinity",
- "burglar",
- "dove",
- "warden",
- "sponge",
- "rooster",
- "barge",
- "gorilla",
- "wharf",
- "stallion",
- "orchard",
- "biographer",
- "wheelbarrow",
- "hurricane",
- "stronghold",
- "lavender",
- "leash",
- "stairwell",
- "doorstep",
- "negotiator",
- "sewer",
- "backbone",
- "rite",
- "vine",
- "gypsy",
- "gland",
- "nightclub",
- "cavity",
- "butler",
- "peach",
- "tack",
- "fossil",
- "glitter",
- "destroyer",
- "flyer",
- "roller",
- "cruiser",
- "dude",
- "bodyguard",
- "corral",
- "coroner",
- "spice",
- "wrench",
- "sock",
- "safe",
- "broth",
- "moth",
- "vice",
- "gender",
- "puppy",
- "sculptor",
- "printer",
- "handbag",
- "lobbyist",
- "comedian",
- "challenger",
- "telegraph",
- "cartridge",
- "walnut",
- "puddle",
- "crescent",
- "tanker",
- "stoop",
- "clergyman",
- "opener",
- "convertible",
- "biologist",
- "fuse",
- "carnival",
- "gangster",
- "mallet",
- "charcoal",
- "mortar",
- "plasma",
- "condominium",
- "muck",
- "workplace",
- "serpent",
- "sill",
- "swallow",
- "thicket",
- "bribe",
- "trough",
- "pudding",
- "alcove",
- "flint",
- "cube",
- "pasta",
- "countess",
- "scroll",
- "bloom",
- "postcard",
- "relish",
- "inventor",
- "chisel",
- "cutter",
- "stud",
- "seminary",
- "coil",
- "flare",
- "whiff",
- "caretaker",
- "mediator",
- "lookout",
- "blackboard",
- "pocketbook",
- "plaintiff",
- "manor",
- "gambler",
- "starch",
- "tonic",
- "salon",
- "pendulum",
- "shoreline",
- "hail",
- "refinery",
- "commando",
- "dryer",
- "rust",
- "bunker",
- "protector",
- "sage",
- "blueprint",
- "roadway",
- "bouquet",
- "garrison",
- "colt",
- "refuse",
- "swarm",
- "lecturer",
- "switchboard",
- "claw",
- "marker",
- "beak",
- "pantry",
- "mole",
- "jumper",
- "terrorist",
- "gravy",
- "blossom",
- "craftsman",
- "pavilion",
- "yarn",
- "enclosure",
- "sucker",
- "boiler",
- "spade",
- "staple",
- "sling",
- "maniac",
- "musket",
- "idol",
- "snack",
- "airliner",
- "bandage",
- "diner",
- "astronomer",
- "radiator",
- "booklet",
- "turbine",
- "vise",
- "bakery",
- "portal",
- "abyss",
- "airfield",
- "wastebasket",
- "lapel",
- "hearse",
- "schooner",
- "carrot",
- "speck",
- "kite",
- "vent",
- "plow",
- "membrane",
- "waterfall",
- "matron",
- "cork",
- "trooper",
- "hinge",
- "hoard",
- "umpire",
- "slug",
- "felt",
- "sentry",
- "mushroom",
- "linebacker",
- "parachute",
- "teller",
- "plum",
- "neutron",
- "lizard",
- "torpedo",
- "helm",
- "cardboard",
- "replica",
- "casket",
- "squirrel",
- "hitch",
- "pirate",
- "vinyl",
- "moat",
- "tablespoon",
- "aroma",
- "healer",
- "screenplay",
- "examiner",
- "strawberry",
- "outpost",
- "bookcase",
- "cashmere",
- "bikini",
- "pastry",
- "seaman",
- "emerald",
- "entrepreneur",
- "thorn",
- "cavern",
- "swivel",
- "outlaw",
- "tapestry",
- "covering",
- "proletariat",
- "turnover",
- "coyote",
- "bumper",
- "champ",
- "creep",
- "boxer",
- "fodder",
- "paddle",
- "tattoo",
- "robber",
- "carbine",
- "oratory",
- "drummer",
- "chili",
- "dung",
- "magnet",
- "jukebox",
- "dune",
- "subpoena",
- "washer",
- "brace",
- "helper",
- "crisp",
- "boulevard",
- "cashier",
- "deadlock",
- "oyster",
- "chasm",
- "heater",
- "beacon",
- "bile",
- "janitor",
- "juncture",
- "chimpanzee",
- "suede",
- "mosquito",
- "cooler",
- "chancellor",
- "beggar",
- "float",
- "blush",
- "vampire",
- "disciple",
- "pedestrian",
- "incline",
- "beaver",
- "grill",
- "denim",
- "wreath",
- "relic",
- "rancher",
- "turret",
- "goalie",
- "steer",
- "cyanide",
- "buggy",
- "willow",
- "fireman",
- "halo",
- "laborer",
- "alligator",
- "bead",
- "midget",
- "sleeper",
- "lectern",
- "tutor",
- "chestnut",
- "translator",
- "duke",
- "cedar",
- "transistor",
- "boardwalk",
- "tramp",
- "ornament",
- "sticker",
- "sovereign",
- "enclave",
- "kilt",
- "corporal",
- "baritone",
- "pallet",
- "unicorn",
- "souvenir",
- "veneer",
- "whirlwind",
- "hamlet",
- "parasite",
- "mosque",
- "steamer",
- "maiden",
- "condor",
- "campfire",
- "seafood",
- "crane",
- "hickory",
- "cathode",
- "marrow",
- "parchment",
- "noun",
- "lair",
- "chemist",
- "smack",
- "curry",
- "canteen",
- "grate",
- "professional",
- "fanatic",
- "barbecue",
- "dorm",
- "hatchet",
- "capitalist",
- "fern",
- "plumber",
- "forge",
- "superstar",
- "ether",
- "sash",
- "spaceship",
- "golfer",
- "realist",
- "skillet",
- "bedspread",
- "wand",
- "windowsill",
- "enamel",
- "hoop",
- "patriot",
- "chandelier",
- "goblet",
- "zipper",
- "serum",
- "icebox",
- "cache",
- "streetcar",
- "syringe",
- "bureaucrat",
- "blacksmith",
- "loot",
- "tomahawk",
- "pinball",
- "jersey",
- "brook",
- "pedestal",
- "feeder",
- "soot",
- "gimmick",
- "hash",
- "controller",
- "twig",
- "librarian",
- "vial",
- "dolphin",
- "tuxedo",
- "mathematician",
- "veranda",
- "aperture",
- "gavel",
- "oasis",
- "nebula",
- "woodland",
- "socket",
- "wasteland",
- "leopard",
- "blazer",
- "follower",
- "swimmer",
- "dart",
- "bazaar",
- "sham",
- "parka",
- "primate",
- "attacker",
- "funnel",
- "tablet",
- "tripod",
- "bully",
- "dandy",
- "appliance",
- "explorer",
- "clone",
- "baton",
- "bandit",
- "coconut",
- "teen",
- "phonograph",
- "sniper",
- "cohort",
- "spill",
- "teammate",
- "over",
- "savior",
- "pear",
- "financier",
- "adolescent",
- "teapot",
- "seaweed",
- "roadblock",
- "constable",
- "arcade",
- "keep",
- "anarchist",
- "mailman",
- "sloop",
- "fungus",
- "pesticide",
- "frigate",
- "toothbrush",
- "pumpkin",
- "doorknob",
- "pebble",
- "scrapbook",
- "fiddle",
- "turtleneck",
- "clipboard",
- "rogue",
- "billboard",
- "beverage",
- "grille",
- "pathologist",
- "mesa",
- "goblin",
- "backpack",
- "dungeon",
- "gauze",
- "beret",
- "porridge",
- "scanner",
- "smoker",
- "mite",
- "axle",
- "easel",
- "parrot",
- "antidote",
- "hijacker",
- "venom",
- "baron",
- "birch",
- "protagonist",
- "hulk",
- "cookbook",
- "mage",
- "cricket",
- "smock",
- "cortex",
- "modem",
- "tablecloth",
- "aristocrat",
- "hare",
- "invalid",
- "fingernail",
- "medic",
- "crutch",
- "entertainer",
- "jade",
- "flea",
- "orphanage",
- "adobe",
- "spruce",
- "boar",
- "oracle",
- "cantor",
- "corduroy",
- "buckle",
- "constellation",
- "lard",
- "industrialist",
- "bridegroom",
- "windmill",
- "bungalow",
- "writ",
- "calculator",
- "portico",
- "renegade",
- "iceberg",
- "mosaic",
- "ranger",
- "anvil",
- "satchel",
- "bridle",
- "gateway",
- "sparrow",
- "duct",
- "monsoon",
- "handgun",
- "citadel",
- "convict",
- "tribunal",
- "yoke",
- "midwife",
- "ruby",
- "conduit",
- "excavation",
- "poodle",
- "yeast",
- "chimp",
- "awning",
- "bypass",
- "intestine",
- "rudder",
- "shroud",
- "magistrate",
- "lender",
- "mummy",
- "prop",
- "licence",
- "patrician",
- "cider",
- "bonnet",
- "edifice",
- "mobile",
- "tornado",
- "yogurt",
- "shrubbery",
- "sorcerer",
- "drone",
- "cove",
- "maverick",
- "rook",
- "gauntlet",
- "violinist",
- "thermometer",
- "vomit",
- "deity",
- "reed",
- "tundra",
- "cocoon",
- "percussion",
- "freighter",
- "noose",
- "gully",
- "innkeeper",
- "quiver",
- "stable",
- "expressway",
- "faucet",
- "jock",
- "spike",
- "herald",
- "polyester",
- "parapet",
- "sandstone",
- "skunk",
- "tranquilizer",
- "pharmacy",
- "penicillin",
- "lark",
- "lily",
- "hanger",
- "headset",
- "john",
- "appointee",
- "twine",
- "screwdriver",
- "lacquer",
- "crick",
- "rosary",
- "appendix",
- "eyelid",
- "fingerprint",
- "tick",
- "sailboat",
- "loom",
- "prodigy",
- "scoop",
- "wrapper",
- "planter",
- "evangelist",
- "lotion",
- "toothpaste",
- "curmudgeon",
- "thong",
- "peacock",
- "scoundrel",
- "machete",
- "dishwasher",
- "electrician",
- "tycoon",
- "otter",
- "snail",
- "nobleman",
- "shutter",
- "escalator",
- "girdle",
- "cologne",
- "violet",
- "locale",
- "propeller",
- "pickle",
- "camper",
- "learner",
- "stag",
- "livery",
- "shoot",
- "tiller",
- "jetliner",
- "checkbook",
- "sideboard",
- "squire",
- "newsstand",
- "bastion",
- "grub",
- "redwood",
- "casserole",
- "totem",
- "palette",
- "choreographer",
- "skyscraper",
- "penitentiary",
- "melon",
- "yolk",
- "diver",
- "archbishop",
- "amber",
- "tart",
- "eyeball",
- "hermit",
- "snowstorm",
- "switchblade",
- "frock",
- "piazza",
- "blender",
- "parasol",
- "clover",
- "intern",
- "asteroid",
- "barricade",
- "knapsack",
- "giraffe",
- "mover",
- "naturalist",
- "orderly",
- "shipyard",
- "educator",
- "liberal",
- "filly",
- "lifeguard",
- "pineapple",
- "referee",
- "jigsaw",
- "retailer",
- "amplifier",
- "campground",
- "steamboat",
- "turban",
- "mutton",
- "cobra",
- "contraption",
- "schoolhouse",
- "pane",
- "observatory",
- "ballerina",
- "undershirt",
- "concierge",
- "accordion",
- "slime",
- "gelding",
- "graft",
- "gull",
- "pilgrim",
- "harpy",
- "whirlpool",
- "conditioner",
- "gadget",
- "lathe",
- "antibiotic",
- "shank",
- "artifact",
- "boutique",
- "antagonist",
- "amulet",
- "skier",
- "smith",
- "cracker",
- "snob",
- "spinster",
- "searchlight",
- "respirator",
- "visor",
- "native",
- "hairdresser",
- "gondola",
- "cheerleader",
- "predator",
- "derby",
- "timer",
- "cabbie",
- "clam",
- "windbreaker",
- "antelope",
- "shampoo",
- "raccoon",
- "glider",
- "grail",
- "lavatory",
- "glaze",
- "thunderstorm",
- "valet",
- "baker",
- "sycamore",
- "nozzle",
- "headboard",
- "plume",
- "coupon",
- "knuckle",
- "lighthouse",
- "collaborator",
- "fuselage",
- "saber",
- "shaman",
- "earring",
- "sieve",
- "kiosk",
- "flooring",
- "veterinarian",
- "fireball",
- "carousel",
- "bandanna",
- "glacier",
- "citation",
- "fridge",
- "grocer",
- "snare",
- "repository",
- "battleship",
- "hammock",
- "thug",
- "artichoke",
- "handbook",
- "bugle",
- "precipice",
- "sauna",
- "skater",
- "barbarian",
- "peddler",
- "empress",
- "crocodile",
- "cucumber",
- "steamship",
- "resin",
- "fairway",
- "swan",
- "governess",
- "orchid",
- "ostrich",
- "vicar",
- "navigator",
- "cartoonist",
- "landfill",
- "invader",
- "locality",
- "druid",
- "headlight",
- "nick",
- "kangaroo",
- "pink",
- "headdress",
- "topcoat",
- "atheist",
- "pointer",
- "theologian",
- "beet",
- "undertaker",
- "lineman",
- "hart",
- "periscope",
- "bodice",
- "grandma",
- "wildcat",
- "proton",
- "executioner",
- "mesquite",
- "programmer",
- "mint",
- "aquarium",
- "kerchief",
- "warranty",
- "breeder",
- "conservatory",
- "saxophone",
- "android",
- "bunny",
- "rake",
- "serf",
- "sidewinder",
- "lifeline",
- "stirrup",
- "caper",
- "crepe",
- "primer",
- "spire",
- "spleen",
- "bustle",
- "assessor",
- "sidecar",
- "shingle",
- "pusher",
- "mantelpiece",
- "peat",
- "neurologist",
- "horseshoe",
- "bulldog",
- "joker",
- "juror",
- "highlander",
- "wisp",
- "pharmacist",
- "doughnut",
- "toaster",
- "amphitheater",
- "beau",
- "importer",
- "locket",
- "watermelon",
- "crossbow",
- "rowboat",
- "volleyball",
- "teddy",
- "abode",
- "handyman",
- "centurion",
- "newspaperman",
- "walker",
- "tributary",
- "cleric",
- "inlet",
- "heretic",
- "waistcoat",
- "grizzly",
- "placard",
- "brig",
- "cinder",
- "bunting",
- "gong",
- "deli",
- "putter",
- "cynic",
- "tombstone",
- "scoreboard",
- "biscuit",
- "souffle",
- "premier",
- "auditor",
- "troll",
- "trucker",
- "beetle",
- "bookkeeper",
- "yardstick",
- "wrinkle",
- "private",
- "leper",
- "chiffon",
- "weave",
- "granny",
- "barometer",
- "infirmary",
- "encyclopedia",
- "laundromat",
- "warship",
- "polygraph",
- "dinghy",
- "tween",
- "crayon",
- "sensor",
- "hustler",
- "pediatrician",
- "buckskin",
- "safeguard",
- "overhang",
- "rattlesnake",
- "teacup",
- "potion",
- "canister",
- "thermostat",
- "aviator",
- "abomination",
- "laurel",
- "sweatshirt",
- "psychoanalyst",
- "shopkeeper",
- "delicatessen",
- "sheepskin",
- "billionaire",
- "salami",
- "glen",
- "beech",
- "mime",
- "rouge",
- "skylight",
- "sole",
- "organist",
- "bulwark",
- "stethoscope",
- "godfather",
- "adventurer",
- "runaway",
- "reflector",
- "falcon",
- "scribe",
- "louse",
- "grapevine",
- "marquee",
- "schoolmaster",
- "shooter",
- "townhouse",
- "hostler",
- "coaster",
- "bulldozer",
- "raspberry",
- "workroom",
- "grassland",
- "cooperative",
- "tarpaulin",
- "thyme",
- "racer",
- "diaper",
- "robin",
- "marina",
- "flagship",
- "homemaker",
- "moron",
- "dispatcher",
- "harbour",
- "toddler",
- "rotunda",
- "dolly",
- "guitarist",
- "eggplant",
- "drapery",
- "florist",
- "hive",
- "screenwriter",
- "barman",
- "tumbler",
- "vortex",
- "hostel",
- "armory",
- "padlock",
- "penguin",
- "peel",
- "rascal",
- "cartilage",
- "blank",
- "clasp",
- "racquet",
- "pelt",
- "copse",
- "fissure",
- "tern",
- "heathen",
- "snowball",
- "penthouse",
- "regulator",
- "mutt",
- "airship",
- "alloy",
- "adjunct",
- "pheasant",
- "sleigh",
- "seer",
- "stockade",
- "sledge",
- "bayonet",
- "vulture",
- "postman",
- "breaker",
- "grinder",
- "mannequin",
- "biochemist",
- "goatee",
- "cranberry",
- "sultan",
- "idealist",
- "apocalypse",
- "moor",
- "zombie",
- "javelin",
- "turnpike",
- "forger",
- "commode",
- "bleach",
- "banister",
- "steeple",
- "censor",
- "snowmobile",
- "kaleidoscope",
- "slipper",
- "nanny",
- "kernel",
- "foal",
- "fedora",
- "medallion",
- "jailer",
- "tread",
- "quill",
- "cardigan",
- "prune",
- "internist",
- "smuggler",
- "panacea",
- "cheeseburger",
- "dispenser",
- "chum",
- "sanctum",
- "headband",
- "terrier",
- "latrine",
- "toad",
- "clink",
- "hick",
- "manger",
- "poppy",
- "chaise",
- "beehive",
- "illustrator",
- "paddy",
- "custodian",
- "armoire",
- "daisy",
- "housecoat",
- "policewoman",
- "ointment",
- "chessboard",
- "scepter",
- "linguist",
- "lute",
- "decoy",
- "bullfighter",
- "chador",
- "clarinet",
- "catapult",
- "shanty",
- "dinosaur",
- "tang",
- "scaffold",
- "environmentalist",
- "nightcap",
- "tempest",
- "artisan",
- "geologist",
- "humanist",
- "treadmill",
- "blackberry",
- "brassiere",
- "choke",
- "sitter",
- "elixir",
- "decanter",
- "burlap",
- "seaport",
- "collie",
- "taper",
- "quartermaster",
- "jeweler",
- "tram",
- "mausoleum",
- "skiff",
- "buoy",
- "archaeologist",
- "pendant",
- "junkyard",
- "bullhorn",
- "porthole",
- "pragmatist",
- "stylist",
- "panther",
- "deserter",
- "sorghum",
- "harmonica",
- "olive",
- "defector",
- "purgatory",
- "genie",
- "crowbar",
- "bathhouse",
- "venue",
- "bandstand",
- "catwalk",
- "sapphire",
- "messiah",
- "blackjack",
- "damask",
- "jerkin",
- "bowler",
- "blob",
- "chard",
- "tiara",
- "domino",
- "mainstay",
- "python",
- "felon",
- "sedative",
- "punt",
- "outhouse",
- "raisin",
- "pancake",
- "brooch",
- "slop",
- "dealership",
- "anchorman",
- "custard",
- "tote",
- "mulch",
- "mason",
- "earl",
- "levee",
- "gynecologist",
- "calico",
- "cyclone",
- "lagoon",
- "songwriter",
- "supernova",
- "photon",
- "cobbler",
- "mainspring",
- "prism",
- "weaver",
- "muffin",
- "juniper",
- "fudge",
- "priestess",
- "maelstrom",
- "spaceport",
- "vegetarian",
- "potter",
- "fiend",
- "debutante",
- "charger",
- "appetizer",
- "millet",
- "inferno",
- "mousse",
- "panda",
- "hamper",
- "settler",
- "chowder",
- "turquoise",
- "abbot",
- "bookie",
- "tusk",
- "cellist",
- "turntable",
- "nightstand",
- "shoemaker",
- "isle",
- "steed",
- "stunner",
- "clove",
- "memento",
- "solicitor",
- "rodent",
- "meteor",
- "stenographer",
- "icing",
- "harpoon",
- "cassock",
- "scarecrow",
- "mart",
- "burger",
- "coverlet",
- "wafer",
- "hangout",
- "figurehead",
- "midterm",
- "petticoat",
- "matador",
- "flier",
- "flotilla",
- "mixer",
- "roach",
- "billy",
- "loincloth",
- "winch",
- "blimp",
- "porpoise",
- "workbench",
- "flagpole",
- "reptile",
- "typist",
- "manhole",
- "archipelago",
- "poke",
- "postmaster",
- "alto",
- "climber",
- "deerskin",
- "sweet",
- "wasp",
- "toothpick",
- "lyre",
- "archer",
- "councilor",
- "candelabra",
- "wrestler",
- "marmalade",
- "harpsichord",
- "jetty",
- "monorail",
- "dramatist",
- "sunflower",
- "retriever",
- "redneck",
- "pullover",
- "nectar",
- "swimsuit",
- "curd",
- "mire",
- "deacon",
- "speechwriter",
- "gelatin",
- "booby",
- "stopwatch",
- "bailiff",
- "paperweight",
- "mower",
- "shrub",
- "interceptor",
- "mammoth",
- "cheekbone",
- "repellent",
- "cardiologist",
- "troika",
- "effigy",
- "leech",
- "pellet",
- "weasel",
- "restroom",
- "cauliflower",
- "fruitcake",
- "chateau",
- "tinker",
- "hobo",
- "corset",
- "nutmeg",
- "tentacle",
- "quicksand",
- "mammal",
- "bellhop",
- "mongrel",
- "newscaster",
- "fawn",
- "rationalist",
- "buckboard",
- "disinfectant",
- "corkscrew",
- "sledgehammer",
- "sloth",
- "stopper",
- "berry",
- "guillotine",
- "keyhole",
- "porcupine",
- "cockroach",
- "settee",
- "usher",
- "obstetrician",
- "palisade",
- "spout",
- "cypress",
- "trombone",
- "dame",
- "baboon",
- "chameleon",
- "dressmaker",
- "storehouse",
- "statistician",
- "cloister",
- "urinal",
- "canary",
- "skate",
- "kelp",
- "marine",
- "marksman",
- "eraser",
- "monolith",
- "nutshell",
- "bogey",
- "spindle",
- "nugget",
- "empiricist",
- "prelate",
- "tricycle",
- "catheter",
- "accessory",
- "prod",
- "oscillator",
- "insurer",
- "cask",
- "magnum",
- "accuser",
- "carnation",
- "trapdoor",
- "mutant",
- "jogger",
- "sickle",
- "restaurateur",
- "davenport",
- "rucksack",
- "starship",
- "spaniel",
- "cuckoo",
- "sneaker",
- "aspen",
- "hopper",
- "jumpsuit",
- "washcloth",
- "almond",
- "cooker",
- "dandelion",
- "brazier",
- "cobblestone",
- "slugger",
- "airlock",
- "zebra",
- "kennel",
- "omelet",
- "psychopath",
- "grasshopper",
- "socialite",
- "cornucopia",
- "warlord",
- "vineyard",
- "scraper",
- "doublet",
- "tome",
- "lifeboat",
- "blueberry",
- "footbridge",
- "tourniquet",
- "spore",
- "harbinger",
- "jurist",
- "kitty",
- "cauldron",
"abbey",
- "jasmine",
- "clamp",
- "councilman",
- "cheesecake",
- "ironclad",
- "urchin",
- "sampler",
- "friar",
- "binder",
- "washbasin",
- "earthenware",
- "kitchenette",
- "foundry",
- "ladle",
- "villager",
- "blaster",
- "hummingbird",
- "drawbridge",
- "malt",
- "mugger",
- "keystone",
- "riverboat",
- "anesthesiologist",
- "salsa",
- "prizefighter",
- "chile",
- "cola",
- "scythe",
- "lout",
- "chamberlain",
- "appraiser",
- "isotope",
- "garnet",
- "buzzard",
- "botanist",
- "sari",
- "skullcap",
- "journeyman",
- "parson",
- "blower",
- "taxicab",
- "publicist",
- "casement",
- "interrogator",
- "shoestring",
- "behemoth",
- "negligee",
- "heath",
- "negative",
- "toga",
- "turnip",
- "stepladder",
- "loon",
- "businesswoman",
- "parlour",
- "concertina",
- "rampart",
- "chime",
- "hyena",
- "sweetener",
- "lioness",
- "escarpment",
- "mimic",
- "gnat",
- "hothouse",
- "stateroom",
- "nutritionist",
- "surveyor",
- "stagecoach",
- "lockup",
- "compost",
- "sprinkler",
- "valentine",
- "minstrel",
- "nursemaid",
- "courtier",
- "spool",
- "noodle",
- "periodical",
- "earlobe",
- "nimbus",
- "innovator",
- "straitjacket",
- "kidnapper",
- "estuary",
- "duster",
- "motorboat",
- "kicker",
- "yeoman",
- "firearm",
- "granddaddy",
- "projectile",
- "toxin",
- "phantom",
- "acolyte",
- "corpsman",
- "duchess",
- "delinquent",
- "operative",
- "megaphone",
- "curate",
- "dermatologist",
- "mango",
- "moccasin",
- "marionette",
- "ooze",
- "twill",
- "trowel",
- "parkway",
- "snapper",
- "flagon",
- "butte",
- "thunderbolt",
- "dike",
- "cowbell",
- "drifter",
- "snot",
- "tortoise",
- "lattice",
- "strudel",
- "composite",
- "neurosurgeon",
- "mariner",
- "kiln",
- "archeologist",
- "winery",
- "albatross",
- "gunboat",
- "cassava",
- "poplar",
- "obelisk",
- "blubber",
- "thorax",
- "leotard",
- "despot",
- "lyricist",
- "lumberjack",
- "pagan",
- "sturgeon",
- "chambermaid",
- "whisk",
- "copter",
- "shipwreck",
- "clipper",
- "notepad",
- "jackal",
- "adhesive",
- "mermaid",
- "omelette",
- "tracer",
- "seagull",
- "needler",
- "caterpillar",
- "impostor",
- "playpen",
- "seamstress",
+ "abbot",
+ "abdomen",
+ "abode",
+ "abomination",
"absolutist",
- "cadaver",
- "agitator",
- "greatcoat",
- "superstructure",
- "bough",
- "anchorage",
- "samovar",
- "burrow",
- "hydrant",
- "paintbrush",
- "chuck",
- "trumpeter",
- "ferret",
- "salamander",
- "mace",
- "individualist",
- "synthesizer",
- "thoroughbred",
- "cupola",
- "ruffle",
- "skeptic",
- "chalice",
- "sapling",
- "creeper",
- "galleon",
- "holly",
- "gravestone",
- "nymph",
- "boxcar",
- "refractor",
- "voucher",
- "thimble",
- "castor",
- "peppermint",
- "nightdress",
- "redoubt",
- "invoice",
- "sprig",
- "piglet",
- "piper",
- "lackey",
- "breastplate",
- "gadfly",
- "chemise",
- "sediment",
- "cannibal",
- "tulip",
- "caramel",
- "cornerback",
- "insecticide",
- "glassware",
- "damper",
- "colonist",
- "ogre",
- "cowl",
- "garter",
- "overpass",
- "potpourri",
- "corsage",
- "mobster",
- "sandal",
- "pecan",
- "ecologist",
- "quagmire",
- "agronomist",
- "firecracker",
- "mulberry",
- "hoist",
- "discotheque",
- "spar",
- "beeper",
- "bouncer",
- "burnout",
- "welder",
- "mortuary",
- "incubator",
- "gulch",
- "notary",
- "speedometer",
- "mitt",
- "footman",
- "cleaver",
- "daybed",
- "laddie",
- "juggler",
- "acrobat",
- "hourglass",
- "onyx",
- "mandarin",
- "democrat",
- "sorority",
- "badger",
- "explosive",
- "spatula",
- "alder",
- "nightstick",
- "salve",
- "drunk",
- "buttress",
- "bidet",
- "buffoon",
- "mullah",
- "spotter",
- "chalet",
- "rattler",
- "beagle",
- "trapeze",
- "fiddler",
- "fillet",
- "luncheonette",
- "purveyor",
- "buttonhole",
- "churchman",
- "jester",
- "fleece",
- "spigot",
- "leaflet",
- "beaker",
- "experimenter",
- "cantaloupe",
- "flue",
- "commoner",
- "boathouse",
- "singularity",
- "gage",
- "paratrooper",
- "pitchfork",
- "playhouse",
- "tripe",
- "stylus",
- "pacemaker",
- "emporium",
- "trapper",
- "pulley",
- "candlestick",
- "checkerboard",
- "surcoat",
- "toolbox",
- "hunchback",
- "arbitrator",
- "miller",
- "tender",
- "gabardine",
- "quack",
- "foxhole",
- "circlet",
- "bivouac",
- "dachshund",
- "puke",
- "bagel",
- "nomad",
- "opal",
- "firebox",
- "ratchet",
- "cheque",
- "footstool",
- "velour",
- "barrister",
- "plough",
- "broomstick",
- "sore",
- "noble",
- "machinist",
- "waffle",
- "guardhouse",
- "sabre",
- "paraffin",
- "bougainvillea",
- "cyclist",
- "meteorologist",
- "demagogue",
- "astrologer",
- "zygote",
- "anchovy",
- "scullery",
- "turnstile",
- "gaslight",
- "paprika",
- "gurney",
- "fount",
- "jackknife",
- "still",
- "butternut",
- "miniskirt",
- "salver",
- "tugboat",
- "gizzard",
- "mercenary",
- "matchbook",
- "barb",
- "yarmulke",
- "char",
- "metronome",
- "tine",
- "carnivore",
- "armband",
- "polder",
- "bankroll",
- "stroller",
- "saxophonist",
- "gruel",
- "juicer",
- "scooter",
- "socialist",
- "ember",
- "scorecard",
- "parakeet",
- "pixie",
- "anesthetist",
- "physiologist",
- "coverall",
- "lubricant",
- "mourner",
- "rime",
- "pistachio",
- "monocle",
- "toupee",
- "eyelash",
- "seesaw",
- "tsar",
- "vagabond",
- "rhinestone",
- "viper",
- "planetoid",
- "catamaran",
- "wigwam",
- "hoodlum",
- "tableware",
- "umber",
- "philanthropist",
- "dissenter",
- "conch",
- "angler",
- "setter",
- "grader",
- "kneecap",
- "birdbath",
- "tuba",
- "houseboat",
- "sable",
- "coolie",
- "pharaoh",
- "dollhouse",
- "greenback",
- "freelancer",
- "hairpin",
- "juggernaut",
- "sander",
- "surfer",
- "greengrocer",
- "dumbbell",
- "sidearm",
- "agnostic",
- "tassel",
- "sextant",
- "vocalist",
- "walleye",
- "highball",
- "godmother",
- "motorbike",
- "hassock",
- "psychotherapist",
- "calabash",
- "relativist",
- "packer",
- "digger",
- "banshee",
- "autocrat",
- "muskrat",
- "extinguisher",
- "hospice",
- "mastermind",
- "figurine",
- "epidemiologist",
- "minaret",
- "weatherman",
- "cistern",
- "werewolf",
- "bricklayer",
- "obsidian",
- "blackbird",
- "schmuck",
- "handrail",
- "sandbag",
- "sesame",
- "quark",
- "sundae",
- "dipper",
- "mould",
- "statuette",
- "cornet",
- "lilac",
- "geisha",
- "foist",
- "percussionist",
- "wyrm",
- "slough",
- "twister",
- "pinkie",
- "fief",
- "critter",
- "haystack",
- "skimmer",
- "geyser",
- "tabernacle",
- "gargoyle",
- "projectionist",
- "betrayer",
- "trawler",
- "teakettle",
- "geneticist",
- "centrifuge",
- "workstation",
- "lampshade",
- "carafe",
- "rave",
- "junior",
- "rapier",
- "landmass",
- "forester",
- "gymnast",
- "gnome",
- "drumstick",
- "glob",
- "academic",
- "knocker",
- "grendel",
- "whaler",
- "stork",
- "gill",
- "locksmith",
- "henchman",
- "wellspring",
- "wipe",
- "sportscaster",
- "impersonator",
- "shrew",
- "loader",
- "magnolia",
- "cudgel",
- "glutton",
- "tarp",
- "chaperone",
- "imposter",
- "cannonball",
- "woodpecker",
- "tumbleweed",
- "gardenia",
- "gramophone",
- "semaphore",
- "dogwood",
- "sirloin",
- "pagoda",
- "belfry",
- "cubbyhole",
- "greyhound",
- "savanna",
- "copier",
- "nightshirt",
- "boatyard",
- "marshmallow",
- "thrush",
- "sweeper",
- "chimera",
- "overlord",
- "lollipop",
- "pastel",
- "laminate",
- "tendril",
- "hanky",
- "amethyst",
- "watchtower",
- "dryad",
- "prefect",
- "tong",
- "croissant",
- "brioche",
- "thistle",
- "dumpling",
- "marketer",
- "oboe",
- "tabby",
- "bassist",
- "doggy",
- "ghoul",
- "pushcart",
- "sourdough",
- "meteorite",
- "caboose",
- "junket",
- "iguana",
- "reaper",
- "sharpshooter",
- "minnow",
- "skyrocket",
- "biker",
- "underwriter",
- "biplane",
- "server",
- "hiker",
- "electrolyte",
- "mascot",
- "sherbet",
- "carillon",
- "decal",
- "underground",
- "automaton",
- "palladium",
+ "abyss",
"acacia",
- "geographer",
- "bludgeon",
- "fitter",
- "atoll",
- "fife",
- "barracuda",
- "mortician",
- "cherub",
- "antler",
- "cravat",
- "scorpion",
- "possum",
- "girder",
- "adapter",
- "mousetrap",
- "steppe",
- "hypochondriac",
- "conga",
- "citron",
- "bolster",
- "wren",
- "mountaineer",
- "cesspool",
- "barrette",
- "miser",
- "cookstove",
- "cummerbund",
- "labourer",
- "ascot",
- "wraith",
- "tarantula",
- "toffee",
- "pituitary",
- "liana",
- "highboy",
- "dumpster",
- "sandbox",
- "alchemist",
- "pacifier",
- "republican",
- "electrocardiogram",
- "recliner",
- "aqueduct",
- "handmaiden",
- "hedgehog",
- "corsair",
- "hutch",
- "fastness",
- "grandparent",
- "ringleader",
- "transformer",
- "ceramic",
- "tomcat",
- "harvester",
- "ream",
- "rifleman",
- "nightie",
- "goaltender",
- "comforter",
- "hostelry",
- "gladiator",
- "bombard",
- "wonderland",
- "roadhouse",
- "schoolmarm",
- "portiere",
- "howitzer",
- "grouper",
- "amoeba",
- "teamster",
- "bandana",
- "sapper",
- "leviathan",
- "hamster",
- "sheikh",
- "creel",
- "lurcher",
- "pantsuit",
- "deodorant",
- "soybean",
- "washboard",
- "underpass",
- "paramour",
- "microbe",
- "radiologist",
- "salesperson",
- "signpost",
- "sepulcher",
- "iconoclast",
- "nunnery",
- "carryall",
- "nettle",
- "jaguar",
- "odometer",
- "mussel",
- "hacksaw",
- "broadsword",
- "archangel",
- "powerboat",
- "pylon",
- "toboggan",
- "trampoline",
+ "academic",
+ "academy",
+ "accessory",
+ "accordion",
+ "accountant",
+ "accuser",
+ "acid",
+ "acolyte",
"acorn",
- "forklift",
- "dragonet",
- "ligament",
- "arrowhead",
- "conversationalist",
- "diorama",
- "talc",
- "incubus",
- "rhododendron",
- "bumblebee",
- "bullfrog",
- "tankard",
- "ferryman",
- "garret",
- "copywriter",
- "bookseller",
- "quiche",
- "spitball",
- "marshland",
- "beautician",
- "daredevil",
- "racehorse",
- "tradesman",
- "ruffian",
- "ringmaster",
- "technocrat",
- "icehouse",
- "ventilator",
- "milkmaid",
- "tribesman",
- "hailstorm",
- "pinafore",
- "ophthalmologist",
- "caldron",
- "fjord",
- "trinket",
- "ventriloquist",
- "grindstone",
- "ingot",
- "pillbox",
- "scimitar",
- "truncheon",
- "damsel",
- "papaya",
- "workhouse",
- "nightingale",
- "entomologist",
- "wicket",
- "logician",
- "gatekeeper",
- "slingshot",
- "titan",
- "brawler",
- "particulate",
- "surfboard",
- "almanac",
- "pepperoni",
- "boor",
- "bannister",
- "pretzel",
- "pallbearer",
- "airframe",
- "milkshake",
- "battlement",
- "dragonfly",
- "nerd",
- "blockhouse",
- "donut",
- "backhoe",
- "collier",
- "footlocker",
- "raindrop",
- "pomegranate",
- "dunce",
- "mangrove",
- "boxwood",
- "briar",
- "trickster",
- "caveman",
- "maggot",
- "blindfold",
- "sunbeam",
- "chrysanthemum",
- "flowerpot",
- "satrap",
- "warbler",
- "hubcap",
- "baseboard",
- "shire",
- "kraken",
- "goatskin",
- "doormat",
- "diadem",
- "superhighway",
- "zoologist",
- "exterminator",
- "actuary",
- "hatter",
- "earpiece",
- "dormer",
- "timberland",
- "hypnotist",
- "claymore",
- "satyr",
- "eatery",
- "seashell",
- "radish",
- "router",
- "dinette",
- "trombonist",
- "rivet",
- "whelp",
- "mitten",
- "conciliator",
- "chine",
- "stockyard",
- "vandal",
- "hornet",
- "fledgling",
- "blowpipe",
- "backstop",
- "bedpan",
- "spacesuit",
- "stoneware",
- "cabana",
- "boater",
- "lawnmower",
- "shaver",
- "orthodontist",
- "extrovert",
- "harpist",
- "rayon",
- "flipper",
- "mullet",
- "squatter",
- "commodore",
- "newlywed",
- "chiropractor",
- "arsonist",
- "wrecker",
- "meatball",
- "bobcat",
- "camcorder",
- "pasty",
- "classicist",
- "cryptographer",
- "honeycomb",
- "barker",
- "myrtle",
- "marlin",
- "capon",
- "toenail",
- "auger",
- "bauble",
- "rube",
- "flophouse",
- "sardine",
- "fang",
- "clavicle",
- "quince",
- "tibia",
- "bramble",
- "woodchuck",
- "stole",
- "tuner",
- "arranger",
- "chiton",
- "swampland",
- "libertarian",
- "pegboard",
- "dork",
- "wishbone",
- "millstone",
- "snorkel",
- "snowplow",
- "trespasser",
- "snowflake",
- "evergreen",
- "clog",
- "cougar",
- "wattle",
- "pansy",
- "pulsar",
- "landau",
- "meteoroid",
- "meringue",
- "cultivator",
- "gazelle",
- "demitasse",
- "skewer",
- "sorbet",
- "hologram",
- "rivulet",
- "flail",
- "impala",
- "persimmon",
- "snowman",
- "starling",
- "herder",
- "stinker",
- "colander",
- "armadillo",
- "debater",
- "birdcage",
- "baroness",
- "aureole",
- "astrophysicist",
- "flatboat",
- "stilt",
- "barbell",
- "fishnet",
- "jackrabbit",
- "oceanographer",
- "earthling",
- "foothill",
- "fairyland",
- "sawhorse",
- "dustpan",
- "woodworker",
- "archivist",
- "bassinet",
- "torte",
- "caddy",
- "microbiologist",
- "urologist",
- "tambourine",
- "cowgirl",
- "bagpipe",
- "coif",
- "adder",
- "decoder",
- "stave",
+ "acreage",
+ "acrobat",
"acrylic",
- "inkwell",
- "constrictor",
- "seaplane",
- "dredge",
- "storyboard",
- "rafter",
- "blowgun",
- "blowtorch",
- "mallard",
- "toxicologist",
- "fencer",
- "golem",
- "heirloom",
- "canine",
- "emcee",
- "eyelet",
- "tepee",
- "buccaneer",
- "parkland",
- "phaeton",
- "lanyard",
- "castaway",
- "meson",
- "bouillabaisse",
- "stinger",
- "crimp",
- "jackhammer",
- "strongbox",
- "cobweb",
- "couturier",
- "chalkboard",
- "basilisk",
- "duckling",
- "floodlight",
- "truss",
- "sprite",
- "esplanade",
- "shipwright",
- "whisker",
- "rickshaw",
- "ferryboat",
- "remover",
- "diva",
- "tortilla",
- "birder",
- "harrier",
- "tamale",
- "cheetah",
- "protester",
- "stockroom",
- "factotum",
+ "activist",
+ "actor",
+ "actress",
+ "actuary",
+ "adapter",
+ "adder",
+ "adhesive",
+ "adjunct",
+ "administrator",
+ "admiral",
+ "adobe",
+ "adolescent",
+ "adult",
+ "adventurer",
+ "adversary",
+ "advocate",
+ "aerial",
"aeroplane",
- "clarinetist",
- "undergarment",
- "keepsake",
- "groupie",
- "scallop",
- "screamer",
- "presenter",
- "centaur",
- "curio",
- "grandmaster",
- "finisher",
- "luminary",
- "islet",
- "apricot",
- "huckleberry",
- "showgirl",
- "cornea",
- "rower",
- "gopher",
- "mandolin",
- "calyx",
- "ironworker",
- "currant",
- "anthropoid",
- "woodcutter",
- "magpie",
- "minion",
- "scamp",
- "snowshoe",
- "brisket",
- "choker",
- "stevedore",
- "plantain",
- "tipper",
- "seismometer",
- "chipmunk",
- "tuber",
- "demographer",
- "turncoat",
- "demesne",
- "oiler",
- "mackinaw",
- "flutist",
- "pram",
- "auteur",
- "hedonist",
- "tutu",
- "sycophant",
- "registrar",
- "neckerchief",
- "clinician",
- "pinwheel",
- "eyedropper",
- "macaw",
- "valedictorian",
- "anatomist",
- "nuke",
- "cinematographer",
- "icicle",
- "legume",
- "masseur",
- "vertebra",
- "stele",
- "streamer",
- "flamethrower",
"agate",
+ "agency",
+ "agent",
+ "agitator",
+ "agnostic",
+ "agronomist",
+ "aide",
+ "airfield",
+ "airframe",
+ "airliner",
+ "airlock",
+ "airplane",
+ "airport",
+ "airship",
+ "aisle",
+ "alarm",
+ "albatross",
+ "album",
+ "alchemist",
+ "alcove",
+ "alder",
+ "alien",
+ "alley",
+ "alligator",
+ "alloy",
+ "ally",
+ "almanac",
+ "almond",
+ "altar",
+ "alto",
+ "amateur",
+ "ambassador",
+ "amber",
+ "ambulance",
+ "amethyst",
+ "ammunition",
+ "amoeba",
+ "amphitheater",
+ "amplifier",
+ "amulet",
+ "analyst",
+ "anarchist",
+ "anatomist",
+ "anchor",
+ "anchorage",
+ "anchorman",
+ "anchovy",
+ "android",
+ "anesthesiologist",
+ "anesthetist",
+ "angel",
+ "angler",
+ "animal",
+ "ankle",
+ "answer",
+ "antagonist",
+ "antelope",
+ "antenna",
+ "anthropoid",
+ "anthropologist",
+ "antibiotic",
+ "antidote",
+ "antler",
+ "anvil",
+ "apartment",
+ "aperture",
+ "apocalypse",
+ "appendix",
+ "appetizer",
+ "apple",
+ "appliance",
+ "appointee",
+ "appraiser",
+ "apprentice",
+ "apricot",
+ "apron",
+ "aquarium",
+ "aqueduct",
+ "arbitrator",
+ "arcade",
+ "arch",
+ "archaeologist",
+ "archangel",
+ "archbishop",
+ "archeologist",
+ "archer",
+ "archipelago",
+ "architect",
+ "archivist",
+ "arena",
+ "aristocrat",
+ "armadillo",
+ "armband",
+ "armchair",
+ "armoire",
+ "armor",
+ "armory",
+ "army",
+ "aroma",
+ "arranger",
+ "arrow",
+ "arrowhead",
+ "arsonist",
+ "artichoke",
+ "article",
+ "artifact",
+ "artisan",
+ "artist",
+ "ascot",
+ "aspen",
+ "assassin",
+ "assessor",
+ "assistant",
+ "associate",
+ "asteroid",
+ "astrologer",
+ "astronaut",
+ "astronomer",
+ "astrophysicist",
+ "asylum",
+ "atheist",
+ "athlete",
+ "atmosphere",
+ "atoll",
+ "atom",
+ "attacker",
+ "attendant",
+ "attic",
+ "attorney",
+ "audience",
+ "auditor",
+ "auditorium",
+ "auger",
+ "aunt",
+ "aureole",
+ "auteur",
+ "author",
+ "autocrat",
+ "automaton",
+ "automobile",
+ "avenue",
+ "aviator",
+ "award",
+ "awning",
+ "axis",
+ "axle",
+ "babe",
+ "baboon",
+ "bachelor",
+ "backbone",
+ "backhoe",
+ "backpack",
+ "backstop",
+ "backyard",
+ "bacon",
+ "badge",
+ "badger",
+ "bagel",
+ "baggage",
+ "bagpipe",
+ "bailiff",
+ "bait",
+ "baker",
+ "bakery",
+ "balcony",
+ "ball",
+ "ballerina",
+ "balloon",
+ "ballroom",
+ "bamboo",
+ "banana",
+ "band",
+ "bandage",
+ "bandana",
+ "bandanna",
+ "bandit",
+ "bandstand",
+ "banister",
+ "bank",
+ "banker",
+ "bankroll",
+ "banner",
+ "bannister",
+ "banshee",
+ "barb",
+ "barbarian",
+ "barbecue",
+ "barbell",
+ "barber",
+ "bard",
+ "barge",
+ "baritone",
+ "bark",
+ "barker",
+ "barman",
+ "barn",
+ "barometer",
+ "baron",
+ "baroness",
+ "barracuda",
+ "barrel",
+ "barrette",
+ "barricade",
+ "barrier",
+ "barrister",
+ "bartender",
+ "baseball",
+ "baseboard",
+ "basement",
+ "basilisk",
+ "basin",
+ "basket",
+ "basketball",
+ "bassinet",
+ "bassist",
+ "bastion",
+ "bath",
+ "bathhouse",
+ "bathrobe",
+ "bathroom",
+ "bathtub",
+ "baton",
+ "battery",
+ "battlement",
+ "battleship",
+ "bauble",
+ "bayonet",
+ "bazaar",
+ "beach",
+ "beacon",
+ "bead",
+ "beagle",
+ "beak",
+ "beaker",
+ "beam",
+ "bean",
+ "bear",
+ "beard",
+ "beast",
+ "beau",
+ "beautician",
+ "beaver",
+ "bedpan",
+ "bedroom",
+ "bedspread",
+ "beech",
+ "beef",
+ "beehive",
+ "beeper",
+ "beet",
+ "beetle",
+ "beggar",
+ "behemoth",
+ "being",
+ "belfry",
+ "believer",
+ "bell",
+ "bellhop",
+ "belly",
+ "belt",
+ "bench",
+ "beret",
+ "berry",
+ "betrayer",
+ "beverage",
+ "bicycle",
+ "bidet",
+ "bike",
+ "biker",
+ "bikini",
+ "bile",
+ "bill",
+ "billboard",
+ "billionaire",
+ "billy",
+ "binder",
+ "biochemist",
+ "biographer",
+ "biologist",
+ "biplane",
+ "birch",
+ "bird",
+ "birdbath",
+ "birdcage",
+ "birder",
+ "biscuit",
+ "bishop",
+ "bivouac",
+ "blackberry",
+ "blackbird",
+ "blackboard",
+ "blackjack",
+ "blacksmith",
+ "bladder",
+ "blade",
+ "blank",
+ "blanket",
+ "blaster",
+ "blazer",
+ "bleach",
+ "blender",
+ "blimp",
+ "blindfold",
+ "blizzard",
+ "blob",
+ "block",
+ "blockhouse",
+ "blood",
+ "bloom",
+ "blossom",
+ "blower",
+ "blowgun",
+ "blowpipe",
+ "blowtorch",
+ "blubber",
+ "bludgeon",
+ "blueberry",
+ "blueprint",
+ "bluff",
+ "blush",
+ "boar",
+ "board",
+ "boardwalk",
+ "boat",
+ "boater",
+ "boathouse",
+ "boatyard",
+ "bobcat",
+ "bodice",
+ "body",
+ "bodyguard",
+ "bogey",
+ "boiler",
+ "bolster",
+ "bolt",
+ "bomb",
+ "bombard",
+ "bomber",
+ "bone",
+ "bonnet",
+ "booby",
+ "book",
+ "bookcase",
+ "bookie",
+ "bookkeeper",
+ "booklet",
+ "bookseller",
+ "bookstore",
+ "boor",
+ "boot",
+ "booth",
+ "boss",
+ "botanist",
+ "bottle",
+ "bougainvillea",
+ "bough",
+ "bouillabaisse",
+ "boulder",
+ "boulevard",
+ "bouncer",
+ "bouquet",
+ "boutique",
+ "bowl",
+ "bowler",
+ "boxcar",
+ "boxer",
+ "boxwood",
+ "boyfriend",
+ "brace",
+ "bracelet",
+ "brain",
+ "brake",
+ "bramble",
+ "branch",
+ "brass",
+ "brassiere",
+ "brawler",
+ "brazier",
+ "break",
+ "breaker",
+ "breakfast",
+ "breastplate",
+ "breeder",
+ "breeze",
+ "briar",
+ "bribe",
+ "brick",
+ "bricklayer",
+ "bride",
+ "bridegroom",
+ "bridge",
+ "bridle",
+ "briefcase",
+ "brig",
+ "brioche",
+ "brisket",
+ "broadsword",
+ "broker",
+ "bronze",
+ "brooch",
+ "brook",
+ "broom",
+ "broomstick",
+ "broth",
+ "brother",
+ "brush",
+ "bubble",
+ "buccaneer",
+ "buckboard",
+ "bucket",
+ "buckle",
+ "buckskin",
+ "buddy",
+ "buffalo",
+ "buffet",
+ "buffoon",
+ "buggy",
+ "bugle",
+ "builder",
+ "building",
+ "bulb",
+ "bull",
+ "bulldog",
+ "bulldozer",
+ "bullet",
+ "bullfighter",
+ "bullfrog",
+ "bullhorn",
+ "bully",
+ "bulwark",
+ "bumblebee",
+ "bumper",
+ "bundle",
+ "bungalow",
+ "bunker",
+ "bunny",
+ "bunting",
+ "buoy",
+ "bureau",
+ "bureaucrat",
+ "burger",
+ "burglar",
+ "burlap",
+ "burnout",
+ "burrow",
+ "bush",
+ "businessman",
+ "businesswoman",
+ "bust",
+ "bustle",
+ "butler",
+ "butte",
+ "butterfly",
+ "butternut",
+ "button",
+ "buttonhole",
+ "buttress",
+ "buzzard",
+ "buzzer",
+ "bypass",
+ "cabana",
+ "cabbage",
+ "cabbie",
+ "cabin",
+ "cabinet",
+ "cable",
+ "caboose",
+ "cache",
+ "cadaver",
+ "caddy",
+ "cafeteria",
+ "cage",
"cairn",
- "linden",
- "moray",
- "talon",
+ "cake",
+ "calabash",
+ "calculator",
+ "caldron",
+ "calendar",
+ "calf",
+ "calico",
+ "calyx",
+ "camcorder",
+ "camel",
+ "camera",
"camisole",
+ "camper",
+ "campfire",
+ "campground",
+ "canal",
+ "canary",
+ "candelabra",
+ "candle",
+ "candlestick",
+ "candy",
+ "cane",
+ "canine",
+ "canister",
+ "cannibal",
+ "cannonball",
+ "canoe",
+ "canopy",
+ "cantaloupe",
+ "canteen",
+ "cantor",
+ "canyon",
+ "cape",
+ "caper",
+ "capital",
+ "capitalist",
+ "capon",
+ "capsule",
+ "captain",
+ "carafe",
+ "caramel",
+ "carbine",
+ "carbon",
+ "carcass",
+ "card",
+ "cardboard",
+ "cardigan",
+ "cardinal",
+ "cardiologist",
+ "caretaker",
+ "carillon",
+ "carnation",
+ "carnival",
+ "carnivore",
+ "carousel",
+ "carpenter",
+ "carpet",
+ "carriage",
+ "carrier",
+ "carrot",
+ "carryall",
+ "cart",
+ "cartilage",
+ "carton",
+ "cartoonist",
+ "cartridge",
+ "carving",
+ "casement",
+ "cashier",
+ "cashmere",
+ "cask",
+ "casket",
+ "cassava",
+ "casserole",
+ "cassette",
+ "cassock",
+ "cast",
+ "castaway",
+ "castle",
+ "castor",
+ "catalogue",
+ "catamaran",
+ "catapult",
+ "catcher",
+ "caterpillar",
+ "cathedral",
+ "catheter",
+ "cathode",
+ "catwalk",
+ "cauldron",
+ "cauliflower",
+ "cave",
+ "caveman",
+ "cavern",
+ "cavity",
+ "cedar",
+ "celebrity",
+ "cell",
+ "cellar",
+ "cellist",
+ "cement",
+ "cemetery",
+ "censor",
+ "centaur",
+ "centrifuge",
+ "centurion",
+ "ceramic",
+ "cereal",
+ "certificate",
+ "cesspool",
+ "chador",
+ "chain",
+ "chair",
+ "chairman",
+ "chaise",
+ "chalet",
+ "chalice",
+ "chalk",
+ "chalkboard",
+ "challenger",
+ "chamber",
+ "chamberlain",
+ "chambermaid",
+ "chameleon",
+ "champ",
+ "chancellor",
+ "chandelier",
+ "change",
+ "channel",
+ "chapel",
+ "chaperone",
+ "chaplain",
+ "char",
+ "character",
+ "charcoal",
+ "chard",
+ "charger",
+ "chariot",
+ "charm",
+ "chart",
+ "chasm",
+ "chat",
+ "chateau",
+ "chauffeur",
+ "check",
+ "checkbook",
+ "checkerboard",
+ "cheekbone",
+ "cheerleader",
+ "cheeseburger",
+ "cheesecake",
+ "cheetah",
+ "chef",
+ "chemical",
+ "chemise",
+ "chemist",
+ "cheque",
+ "cherry",
+ "cherub",
+ "chessboard",
+ "chest",
+ "chestnut",
+ "chick",
+ "chicken",
+ "chief",
+ "chiffon",
+ "chile",
+ "chili",
+ "chime",
+ "chimera",
+ "chimney",
+ "chimp",
+ "chimpanzee",
+ "chine",
+ "chipmunk",
+ "chiropractor",
+ "chisel",
+ "chiton",
+ "chocolate",
+ "choir",
+ "choke",
+ "choker",
+ "chopper",
+ "choreographer",
+ "chowder",
+ "chrysanthemum",
+ "chuck",
+ "chum",
+ "church",
+ "churchman",
+ "cider",
+ "cinder",
+ "cinema",
+ "cinematographer",
+ "circlet",
+ "circuit",
+ "cistern",
+ "citadel",
+ "citation",
+ "citizen",
+ "citron",
+ "city",
+ "civilian",
+ "clam",
+ "clamp",
+ "clarinet",
+ "clarinetist",
+ "clasp",
+ "classicist",
+ "classroom",
+ "clavicle",
+ "claw",
+ "clay",
+ "claymore",
+ "cleaner",
+ "clearing",
+ "cleaver",
+ "clergyman",
+ "cleric",
+ "clerk",
+ "cliff",
+ "climber",
+ "clinic",
+ "clinician",
+ "clink",
+ "clip",
+ "clipboard",
+ "clipper",
+ "cloak",
+ "clock",
+ "clog",
+ "cloister",
+ "clone",
+ "closet",
+ "cloth",
+ "cloud",
+ "clove",
+ "clover",
+ "clown",
+ "club",
+ "clump",
+ "clutch",
+ "coach",
+ "coal",
+ "coaster",
+ "coat",
+ "cobbler",
+ "cobblestone",
+ "cobra",
+ "cobweb",
+ "cock",
+ "cockroach",
+ "coconut",
+ "cocoon",
+ "coffee",
+ "coffin",
+ "cohort",
+ "coif",
+ "coil",
+ "coin",
+ "cola",
+ "colander",
+ "collaborator",
+ "collar",
+ "colleague",
+ "collector",
+ "college",
+ "collie",
+ "collier",
+ "cologne",
+ "colonel",
+ "colonist",
+ "colt",
+ "column",
+ "columnist",
+ "comb",
+ "comedian",
+ "comet",
+ "comforter",
+ "commander",
+ "commando",
+ "commentator",
+ "commissioner",
+ "commode",
+ "commodore",
+ "commoner",
+ "community",
+ "companion",
+ "company",
+ "compartment",
+ "compass",
+ "competitor",
+ "composer",
+ "composite",
+ "compost",
+ "computer",
+ "comrade",
+ "concertina",
+ "conch",
+ "concierge",
+ "conciliator",
+ "conditioner",
+ "condominium",
+ "condor",
+ "conductor",
+ "conduit",
+ "cone",
+ "conga",
+ "conservative",
+ "conservatory",
+ "console",
+ "constable",
+ "constellation",
+ "constrictor",
+ "consultant",
+ "consumer",
+ "contact",
+ "container",
+ "contender",
+ "continent",
+ "contract",
+ "contractor",
+ "contraption",
+ "controller",
+ "convent",
+ "conversationalist",
+ "convertible",
+ "convict",
+ "cook",
+ "cookbook",
+ "cooker",
+ "cookie",
+ "cookstove",
+ "cooler",
+ "coolie",
+ "cooperative",
+ "copier",
+ "copper",
+ "copse",
+ "copter",
+ "copywriter",
+ "coral",
+ "cord",
+ "corduroy",
+ "cork",
+ "corkscrew",
+ "corn",
+ "cornea",
+ "corner",
+ "cornerback",
+ "cornet",
+ "cornucopia",
+ "coroner",
+ "corporal",
+ "corporation",
+ "corpse",
+ "corpsman",
+ "corral",
+ "correspondent",
+ "corridor",
+ "corsage",
+ "corsair",
+ "corset",
+ "cortex",
+ "costume",
+ "cottage",
+ "cotton",
+ "couch",
+ "cougar",
+ "councilman",
+ "councilor",
+ "counselor",
+ "count",
+ "counter",
+ "countess",
+ "countryside",
+ "coupon",
+ "courier",
+ "court",
+ "courthouse",
+ "courtier",
+ "courtyard",
+ "cousin",
+ "couturier",
+ "cove",
+ "cover",
+ "coverall",
+ "covering",
+ "coverlet",
+ "cowbell",
+ "cowboy",
+ "cowgirl",
+ "cowl",
+ "coyote",
+ "crab",
+ "cracker",
+ "cradle",
+ "craftsman",
+ "cranberry",
+ "crane",
+ "crate",
+ "crater",
+ "cravat",
+ "crayon",
+ "cream",
+ "creature",
+ "creek",
+ "creel",
+ "creep",
+ "creeper",
+ "crepe",
+ "crescent",
+ "crest",
+ "crew",
+ "crib",
+ "crick",
+ "cricket",
+ "criminal",
+ "crimp",
+ "crisp",
+ "critic",
+ "critter",
+ "crocodile",
+ "croissant",
+ "crook",
+ "crop",
+ "cross",
+ "crossbow",
+ "crow",
+ "crowbar",
+ "crown",
+ "cruiser",
+ "crust",
+ "crutch",
+ "cryptographer",
+ "crystal",
+ "cubbyhole",
+ "cube",
+ "cubicle",
+ "cuckoo",
+ "cucumber",
+ "cudgel",
+ "cultivator",
+ "cummerbund",
+ "cupboard",
+ "cupola",
+ "curate",
+ "curator",
+ "curd",
+ "curio",
+ "curmudgeon",
+ "currant",
+ "curry",
+ "curtain",
+ "cushion",
+ "custard",
+ "custodian",
+ "customer",
+ "cutter",
+ "cyanide",
+ "cycle",
+ "cyclist",
+ "cyclone",
+ "cynic",
+ "cypress",
+ "dachshund",
+ "dagger",
+ "dairy",
+ "daisy",
+ "damask",
+ "dame",
+ "damper",
+ "damsel",
+ "dance",
+ "dancer",
+ "dandelion",
+ "dandy",
+ "daredevil",
+ "dart",
+ "date",
+ "daughter",
+ "davenport",
+ "daybed",
+ "deacon",
+ "deadlock",
+ "dealer",
+ "dealership",
+ "death",
+ "debater",
+ "debutante",
+ "decal",
+ "decanter",
+ "deck",
+ "decoder",
+ "decoration",
+ "decoy",
+ "decree",
+ "deerskin",
+ "defector",
+ "defendant",
+ "degree",
+ "deity",
+ "deli",
+ "delicatessen",
+ "delinquent",
+ "demagogue",
+ "demesne",
+ "demitasse",
+ "democrat",
+ "demographer",
+ "demon",
+ "denim",
+ "dentist",
+ "deodorant",
+ "depot",
+ "deputy",
+ "derby",
+ "dermatologist",
+ "desert",
+ "deserter",
+ "designer",
+ "desk",
+ "despot",
+ "dessert",
+ "destroyer",
+ "detective",
+ "developer",
+ "device",
+ "devil",
+ "diadem",
+ "dial",
+ "diamond",
+ "diaper",
+ "diary",
+ "dictator",
+ "dictionary",
+ "diesel",
+ "digger",
+ "dike",
+ "dime",
+ "diner",
+ "dinette",
+ "dinghy",
+ "dinner",
+ "dinosaur",
+ "diorama",
+ "diplomat",
+ "dipper",
+ "director",
+ "directory",
+ "disc",
+ "disciple",
+ "discotheque",
+ "disease",
+ "disguise",
+ "dish",
+ "dishwasher",
+ "disinfectant",
+ "dispatcher",
+ "dispenser",
+ "display",
+ "dissenter",
+ "district",
+ "ditch",
+ "diva",
+ "diver",
+ "dock",
+ "doctor",
+ "document",
+ "doggy",
+ "dogwood",
+ "doll",
+ "dollhouse",
+ "dolly",
+ "dolphin",
+ "dome",
+ "domino",
+ "donkey",
+ "donut",
+ "door",
+ "doorbell",
+ "doorknob",
+ "doorman",
+ "doormat",
+ "doorstep",
+ "doorway",
+ "dork",
+ "dorm",
+ "dormer",
+ "dormitory",
+ "doublet",
+ "dough",
+ "doughnut",
+ "dove",
+ "dragon",
+ "dragonet",
+ "dragonfly",
+ "drain",
+ "dramatist",
+ "drapery",
+ "drawbridge",
+ "drawer",
+ "drawing",
+ "dredge",
+ "dress",
+ "dresser",
+ "dressing",
+ "dressmaker",
+ "drifter",
+ "drill",
+ "drink",
+ "drive",
+ "driver",
+ "driveway",
+ "drone",
+ "drop",
+ "druid",
+ "drum",
+ "drummer",
+ "drumstick",
+ "drunk",
+ "dryad",
+ "dryer",
+ "duchess",
+ "duckling",
+ "duct",
+ "dude",
+ "dugout",
+ "duke",
+ "dumbbell",
+ "dummy",
+ "dump",
+ "dumpling",
+ "dumpster",
+ "dunce",
+ "dune",
+ "dung",
+ "dungeon",
+ "dust",
+ "duster",
+ "dustpan",
+ "dwarf",
+ "dwelling",
+ "eagle",
+ "earl",
+ "earlobe",
+ "earpiece",
+ "earring",
+ "earth",
+ "earthenware",
+ "earthling",
+ "easel",
+ "eatery",
+ "ecologist",
+ "economist",
+ "ecstasy",
+ "edifice",
+ "editor",
+ "educator",
+ "effigy",
+ "eggplant",
+ "elbow",
+ "electrician",
+ "electrocardiogram",
+ "electrolyte",
+ "electron",
+ "elephant",
+ "elevator",
+ "elixir",
+ "embassy",
+ "ember",
+ "emcee",
+ "emerald",
+ "emperor",
+ "empiricist",
+ "emporium",
+ "empress",
+ "enamel",
+ "enclave",
+ "enclosure",
+ "encyclopedia",
+ "enemy",
+ "engine",
+ "engineer",
+ "entertainer",
+ "entertainment",
+ "entomologist",
+ "entrance",
+ "entrepreneur",
+ "envelope",
+ "environment",
+ "environmentalist",
+ "epidemiologist",
+ "eraser",
+ "escalator",
+ "escarpment",
+ "esplanade",
+ "essay",
+ "establishment",
+ "estate",
+ "estuary",
+ "ether",
+ "evangelist",
+ "evergreen",
+ "evidence",
+ "exam",
+ "examiner",
+ "excavation",
+ "executioner",
+ "executive",
+ "experimenter",
+ "explorer",
+ "explosive",
+ "expressway",
+ "exterminator",
+ "extinguisher",
+ "extrovert",
+ "eyeball",
+ "eyebrow",
+ "eyedropper",
+ "eyelash",
+ "eyelet",
+ "eyelid",
+ "fabric",
+ "face",
+ "facility",
+ "factory",
+ "factotum",
+ "faculty",
+ "fairway",
+ "fairy",
+ "fairyland",
+ "falcon",
+ "fanatic",
+ "fang",
+ "farm",
+ "farmer",
+ "fastness",
+ "father",
+ "faucet",
+ "fawn",
+ "feast",
+ "feather",
+ "fedora",
+ "feed",
+ "feeder",
+ "fellow",
+ "felon",
+ "felt",
+ "female",
+ "fence",
+ "fencer",
+ "fern",
+ "ferret",
+ "ferry",
+ "ferryboat",
+ "ferryman",
+ "fertilizer",
+ "festival",
+ "fiber",
+ "fiddle",
+ "fiddler",
+ "fief",
+ "field",
+ "fiend",
+ "fife",
+ "fighter",
+ "figure",
+ "figurehead",
+ "figurine",
+ "file",
+ "fillet",
+ "filly",
+ "film",
+ "final",
+ "financier",
+ "finger",
+ "fingernail",
+ "fingerprint",
+ "finisher",
+ "fire",
+ "firearm",
+ "fireball",
+ "firebox",
+ "firecracker",
+ "fireman",
+ "fireplace",
+ "fisherman",
+ "fishnet",
+ "fissure",
+ "fist",
+ "fitter",
+ "fjord",
+ "flag",
+ "flagon",
+ "flagpole",
+ "flagship",
+ "flail",
+ "flame",
+ "flamethrower",
+ "flannel",
+ "flare",
+ "flashlight",
+ "flask",
+ "flat",
+ "flatboat",
+ "flea",
+ "fledgling",
+ "fleece",
+ "flesh",
+ "flicker",
+ "flier",
+ "flint",
+ "flipper",
+ "float",
+ "flock",
+ "flood",
+ "floodlight",
+ "floor",
+ "flooring",
+ "flophouse",
+ "florist",
+ "flotilla",
+ "flour",
+ "flower",
+ "flowerpot",
+ "flue",
+ "fluid",
+ "flute",
+ "flutist",
+ "flyer",
+ "foal",
+ "foam",
+ "fodder",
+ "foil",
+ "foist",
+ "folder",
+ "foliage",
+ "follower",
+ "food",
+ "fool",
+ "foot",
+ "football",
+ "footbridge",
+ "foothill",
+ "footlocker",
+ "footman",
+ "footstool",
+ "foreman",
+ "forest",
+ "forester",
+ "forge",
+ "forger",
+ "fork",
+ "forklift",
+ "form",
+ "fort",
+ "fortress",
+ "fossil",
+ "foundation",
+ "foundry",
+ "fount",
+ "fountain",
+ "foxhole",
+ "foyer",
+ "fragrance",
+ "frame",
+ "franchise",
+ "fraternity",
+ "freak",
+ "freelancer",
+ "freeway",
+ "freezer",
+ "freighter",
+ "freshman",
+ "friar",
+ "fridge",
+ "friend",
+ "frigate",
+ "frock",
+ "frog",
+ "fruitcake",
+ "fudge",
+ "fuel",
+ "fungus",
+ "funnel",
+ "furnace",
+ "fuse",
+ "fuselage",
+ "gabardine",
+ "gadfly",
+ "gadget",
+ "gage",
+ "galaxy",
+ "galleon",
+ "gallery",
+ "galley",
+ "gambler",
+ "game",
+ "gangster",
+ "garage",
+ "garden",
+ "gardener",
+ "gardenia",
+ "gargoyle",
+ "garlic",
+ "garment",
+ "garnet",
+ "garret",
+ "garrison",
+ "garter",
+ "gaslight",
+ "gasoline",
+ "gate",
+ "gatekeeper",
+ "gateway",
+ "gauge",
+ "gauntlet",
+ "gauze",
+ "gavel",
+ "gazelle",
+ "gear",
+ "geisha",
+ "gelatin",
+ "gelding",
+ "gender",
+ "gene",
+ "general",
+ "generator",
+ "geneticist",
+ "genie",
+ "genius",
+ "geographer",
+ "geologist",
+ "germ",
+ "geyser",
+ "ghost",
+ "ghoul",
+ "giant",
+ "gift",
+ "gill",
+ "gimmick",
+ "giraffe",
+ "girder",
+ "girdle",
+ "girlfriend",
+ "gizzard",
+ "glacier",
+ "gladiator",
+ "gland",
+ "glass",
+ "glassware",
+ "glaze",
+ "glen",
+ "glider",
+ "glitter",
+ "glob",
+ "globe",
+ "glory",
+ "glove",
+ "glue",
+ "glutton",
+ "gnat",
+ "gnome",
+ "goal",
+ "goalie",
+ "goaltender",
+ "goat",
+ "goatee",
+ "goatskin",
+ "goblet",
+ "goblin",
+ "goddess",
+ "godfather",
+ "godmother",
+ "gold",
+ "golem",
+ "golfer",
+ "gondola",
+ "gong",
+ "goose",
+ "gopher",
+ "gorge",
+ "gorilla",
+ "governess",
+ "governor",
+ "gown",
+ "grader",
+ "graduate",
+ "graft",
+ "grail",
+ "grain",
+ "gramophone",
+ "granddaddy",
+ "granddaughter",
+ "grandfather",
+ "grandma",
+ "grandmaster",
+ "grandmother",
+ "grandparent",
+ "grandson",
+ "granite",
+ "granny",
+ "grape",
+ "grapevine",
+ "grass",
+ "grasshopper",
+ "grassland",
+ "grate",
+ "grave",
+ "gravestone",
+ "graveyard",
+ "gravy",
+ "greatcoat",
+ "greenback",
+ "greengrocer",
+ "greenhouse",
+ "grenade",
+ "grendel",
+ "greyhound",
+ "grill",
+ "grille",
+ "grin",
+ "grinder",
+ "grindstone",
+ "grizzly",
+ "grocer",
+ "groom",
+ "grotto",
+ "grouper",
+ "groupie",
+ "grove",
+ "growth",
+ "grub",
+ "gruel",
+ "guard",
+ "guardhouse",
+ "guardian",
+ "guerrilla",
+ "guide",
+ "guillotine",
+ "guitar",
+ "guitarist",
+ "gulch",
+ "gull",
+ "gully",
+ "gunboat",
+ "gurney",
+ "gymnast",
+ "gynecologist",
+ "gypsy",
+ "hack",
+ "hacksaw",
+ "hail",
+ "hailstorm",
+ "hair",
+ "hairdresser",
+ "hairpin",
+ "hallway",
+ "halo",
+ "hamburger",
+ "hamlet",
+ "hammer",
+ "hammock",
+ "hamper",
+ "hamster",
+ "hand",
+ "handbag",
+ "handbook",
+ "handgun",
+ "handkerchief",
+ "handle",
+ "handmaiden",
+ "handrail",
+ "handyman",
+ "hangar",
+ "hanger",
+ "hangout",
+ "hanky",
+ "harbinger",
+ "harbor",
+ "harbour",
+ "hare",
+ "harmonica",
+ "harness",
+ "harp",
+ "harpist",
+ "harpoon",
+ "harpsichord",
+ "harpy",
+ "harrier",
+ "hart",
+ "harvester",
+ "hash",
+ "hassock",
+ "hatch",
+ "hatchet",
+ "hatter",
+ "haven",
+ "hawk",
+ "haystack",
+ "headband",
+ "headboard",
+ "headdress",
+ "headlight",
+ "headset",
+ "healer",
+ "hearse",
+ "heart",
+ "hearth",
+ "heater",
+ "heath",
+ "heathen",
+ "heaven",
+ "hedge",
+ "hedgehog",
+ "hedonist",
+ "heirloom",
+ "helicopter",
+ "helm",
+ "helmet",
+ "help",
+ "helper",
+ "henchman",
+ "herald",
+ "herder",
+ "heretic",
+ "hermit",
+ "hero",
+ "heroine",
+ "hick",
+ "hickory",
+ "highball",
+ "highboy",
+ "highlander",
+ "highway",
+ "hijacker",
+ "hiker",
+ "hill",
+ "hinge",
+ "hippie",
+ "historian",
+ "hitch",
+ "hive",
+ "hoard",
+ "hobby",
+ "hobo",
+ "hoist",
+ "hole",
+ "hollow",
+ "holly",
+ "hologram",
+ "holster",
+ "home",
+ "homemaker",
+ "honey",
+ "honeycomb",
+ "hood",
+ "hoodlum",
+ "hook",
+ "hoop",
+ "hopper",
+ "horn",
+ "hornet",
+ "horse",
+ "horseshoe",
+ "hose",
+ "hospice",
+ "hospital",
+ "host",
+ "hostage",
+ "hostel",
+ "hostelry",
+ "hostess",
+ "hostler",
+ "hotel",
+ "hothouse",
+ "hound",
+ "hourglass",
+ "house",
+ "houseboat",
+ "housecoat",
+ "housekeeper",
+ "housewife",
+ "howitzer",
+ "hubcap",
+ "huckleberry",
+ "hulk",
+ "hull",
+ "humanist",
+ "hummingbird",
+ "hunchback",
+ "hunter",
+ "hurricane",
+ "husband",
+ "hustler",
+ "hutch",
+ "hydrant",
+ "hyena",
+ "hypnotist",
+ "hypochondriac",
+ "iceberg",
+ "icebox",
+ "icehouse",
+ "icicle",
+ "icing",
+ "iconoclast",
+ "idealist",
+ "idiot",
+ "idol",
+ "iguana",
+ "illustrator",
+ "image",
+ "impala",
+ "impersonator",
+ "importer",
+ "imposter",
+ "impostor",
+ "incline",
+ "incubator",
+ "incubus",
+ "indicator",
+ "individualist",
+ "industrialist",
+ "infant",
+ "inferno",
+ "infinity",
+ "infirmary",
+ "informant",
+ "ingot",
+ "ingredient",
+ "inkwell",
+ "inlet",
+ "innkeeper",
+ "innovation",
+ "innovator",
+ "insect",
+ "insecticide",
+ "inspector",
+ "institution",
+ "instructor",
+ "instrument",
+ "insurer",
+ "intellectual",
+ "interceptor",
+ "intercom",
+ "intern",
+ "internist",
+ "interpreter",
+ "interrogator",
+ "intestine",
+ "intruder",
+ "invader",
+ "invalid",
+ "inventor",
+ "investigator",
+ "invitation",
+ "invoice",
+ "iron",
+ "ironclad",
+ "ironworker",
+ "island",
+ "isle",
+ "islet",
+ "isotope",
+ "ivory",
+ "jack",
+ "jackal",
+ "jacket",
+ "jackhammer",
+ "jackknife",
+ "jackrabbit",
+ "jade",
+ "jaguar",
+ "jail",
+ "jailer",
+ "janitor",
+ "jasmine",
+ "javelin",
+ "jelly",
+ "jerk",
+ "jerkin",
+ "jersey",
+ "jester",
+ "jetliner",
+ "jetty",
+ "jewel",
+ "jeweler",
+ "jigsaw",
+ "jock",
+ "jockey",
+ "jogger",
+ "john",
+ "joint",
+ "joker",
+ "journal",
+ "journalist",
+ "journeyman",
+ "judge",
+ "juggernaut",
+ "juggler",
+ "juice",
+ "juicer",
+ "jukebox",
+ "jumper",
+ "jumpsuit",
+ "juncture",
+ "jungle",
+ "junior",
+ "juniper",
+ "junk",
+ "junket",
+ "junkyard",
+ "jurist",
+ "juror",
+ "jury",
+ "kaleidoscope",
+ "kangaroo",
+ "keep",
+ "keepsake",
+ "kelp",
+ "kennel",
+ "kerchief",
+ "kernel",
+ "kettle",
+ "keyboard",
+ "keyhole",
+ "keystone",
+ "kicker",
+ "kidnapper",
+ "kidney",
+ "killer",
+ "kiln",
+ "kilt",
+ "king",
+ "kiosk",
+ "kitchen",
+ "kitchenette",
+ "kite",
+ "kitten",
+ "kitty",
+ "knack",
+ "knapsack",
+ "kneecap",
+ "knife",
+ "knight",
+ "knocker",
+ "knot",
+ "knuckle",
+ "kraken",
+ "laboratory",
+ "laborer",
+ "labourer",
+ "lace",
+ "lackey",
+ "lacquer",
+ "ladder",
+ "laddie",
+ "ladle",
+ "lady",
+ "lagoon",
+ "lair",
+ "lake",
+ "lamb",
+ "laminate",
+ "lamp",
+ "lampshade",
+ "lance",
+ "land",
+ "landau",
+ "landfill",
+ "landlord",
+ "landmass",
+ "lane",
+ "lantern",
+ "lanyard",
+ "lapel",
+ "lard",
+ "lark",
+ "laser",
+ "lathe",
+ "latrine",
+ "lattice",
+ "laundromat",
+ "laundry",
+ "laurel",
+ "lavatory",
+ "lavender",
+ "lawn",
+ "lawnmower",
+ "lawyer",
+ "layer",
+ "lead",
+ "leader",
+ "leaf",
+ "leaflet",
+ "learner",
+ "leash",
+ "leather",
+ "lectern",
+ "lecturer",
+ "leech",
+ "legume",
+ "lemon",
+ "lender",
+ "leopard",
+ "leotard",
+ "leper",
+ "letter",
+ "lettuce",
+ "levee",
+ "level",
+ "lever",
+ "leviathan",
+ "liana",
+ "liar",
+ "liberal",
+ "libertarian",
+ "librarian",
+ "library",
+ "licence",
+ "license",
+ "lieutenant",
+ "lifeboat",
+ "lifeguard",
+ "lifeline",
+ "lift",
+ "ligament",
+ "light",
+ "lighter",
+ "lighthouse",
+ "lightning",
+ "lilac",
+ "lily",
+ "limb",
+ "lime",
+ "limestone",
+ "limousine",
+ "linden",
+ "linebacker",
+ "lineman",
+ "linen",
+ "linguist",
+ "link",
+ "lion",
+ "lioness",
+ "lipstick",
+ "liquid",
+ "list",
+ "literature",
+ "litter",
+ "liver",
+ "livery",
+ "lizard",
+ "loader",
+ "loaf",
+ "lobby",
+ "lobbyist",
+ "lobster",
+ "locale",
+ "locality",
+ "lock",
+ "locker",
+ "locket",
+ "locksmith",
+ "lockup",
+ "locomotive",
+ "lodge",
+ "loft",
+ "logician",
+ "loincloth",
+ "lollipop",
+ "lookout",
+ "loom",
+ "loon",
+ "loot",
+ "lord",
+ "loser",
+ "lotion",
+ "lounge",
+ "louse",
+ "lout",
+ "lover",
+ "lubricant",
+ "lumber",
+ "lumberjack",
+ "luminary",
+ "lunch",
+ "luncheonette",
+ "lung",
+ "lurcher",
+ "lure",
+ "lute",
+ "lyre",
+ "lyricist",
+ "macaw",
+ "mace",
+ "machete",
+ "machine",
+ "machinist",
+ "mackinaw",
+ "madman",
+ "maelstrom",
+ "magazine",
+ "mage",
+ "maggot",
+ "magic",
+ "magician",
+ "magistrate",
+ "magnet",
+ "magnolia",
+ "magnum",
+ "magpie",
+ "mahogany",
+ "maid",
+ "maiden",
+ "mail",
+ "mailbox",
+ "mailman",
+ "mainspring",
+ "mainstay",
+ "major",
+ "male",
+ "mall",
+ "mallard",
+ "mallet",
+ "malt",
+ "mammal",
+ "mammoth",
+ "manager",
+ "mandarin",
+ "mandolin",
+ "mane",
+ "manger",
+ "mango",
+ "mangrove",
+ "manhole",
+ "maniac",
+ "mannequin",
+ "manor",
+ "mansion",
+ "mantelpiece",
+ "mantle",
+ "manual",
+ "manufacturer",
+ "manure",
+ "maple",
+ "marble",
+ "mare",
+ "marina",
+ "marine",
+ "mariner",
+ "marionette",
+ "marker",
+ "market",
+ "marketer",
+ "marketplace",
+ "marksman",
+ "marlin",
+ "marmalade",
+ "marquee",
+ "marrow",
+ "marsh",
+ "marshal",
+ "marshland",
+ "marshmallow",
+ "mart",
+ "mascot",
+ "mask",
+ "mason",
+ "masseur",
+ "mast",
+ "master",
+ "mastermind",
+ "matador",
+ "match",
+ "matchbook",
+ "mate",
+ "material",
+ "mathematician",
+ "matron",
+ "matter",
+ "mattress",
+ "mausoleum",
+ "maverick",
+ "mayor",
+ "maze",
+ "meadow",
+ "meal",
+ "measure",
+ "meatball",
+ "mechanic",
+ "medal",
+ "medallion",
+ "mediator",
+ "medic",
+ "medicine",
+ "megaphone",
+ "melon",
+ "membrane",
+ "memento",
+ "memorial",
+ "mentor",
+ "menu",
+ "mercenary",
+ "merchant",
+ "meringue",
+ "merit",
+ "mermaid",
+ "mesa",
+ "meson",
+ "mesquite",
+ "mess",
+ "message",
+ "messenger",
+ "messiah",
+ "metal",
+ "meteor",
+ "meteorite",
+ "meteoroid",
+ "meteorologist",
+ "meter",
+ "metronome",
+ "microbe",
+ "microbiologist",
+ "microphone",
+ "microscope",
+ "microwave",
+ "midget",
+ "midterm",
+ "midwife",
+ "military",
+ "milk",
+ "milkmaid",
+ "milkshake",
+ "mill",
+ "miller",
+ "millet",
+ "millionaire",
+ "millstone",
+ "mime",
+ "mimic",
+ "minaret",
+ "miner",
+ "mineral",
+ "minion",
+ "miniskirt",
+ "minister",
+ "minnow",
+ "minstrel",
+ "mint",
+ "mire",
+ "mirror",
+ "miser",
+ "missile",
+ "mission",
+ "missionary",
+ "mist",
+ "mistress",
+ "mite",
+ "mitt",
+ "mitten",
+ "mixer",
+ "moat",
+ "mobile",
+ "mobster",
+ "moccasin",
+ "model",
+ "modem",
+ "moisture",
+ "mold",
+ "mole",
+ "molecule",
+ "monastery",
+ "money",
+ "mongrel",
+ "monitor",
+ "monk",
+ "monkey",
+ "monocle",
+ "monolith",
+ "monorail",
+ "monsoon",
+ "monster",
+ "monument",
+ "moon",
+ "moor",
+ "moray",
+ "moron",
+ "mortar",
+ "mortician",
+ "mortuary",
+ "mosaic",
+ "mosque",
+ "mosquito",
+ "moss",
+ "motel",
+ "moth",
+ "mother",
+ "motor",
+ "motorbike",
+ "motorboat",
+ "motorcycle",
+ "mould",
+ "mound",
+ "mount",
+ "mountain",
+ "mountaineer",
+ "mourner",
+ "mouse",
+ "mousetrap",
+ "mousse",
+ "moustache",
+ "mouth",
+ "mover",
+ "movie",
+ "mower",
+ "muck",
+ "muffin",
+ "mugger",
+ "mulberry",
+ "mulch",
+ "mule",
+ "mullah",
+ "mullet",
+ "mummy",
+ "murderer",
+ "muscle",
+ "museum",
+ "mushroom",
+ "musician",
+ "musket",
+ "muskrat",
+ "mussel",
+ "mutant",
+ "mutt",
+ "mutton",
+ "muzzle",
+ "myrtle",
+ "nail",
+ "nanny",
+ "napkin",
+ "native",
+ "naturalist",
+ "navigator",
+ "navy",
+ "nebula",
+ "neck",
+ "neckerchief",
+ "necklace",
+ "nectar",
+ "needle",
+ "needler",
+ "negative",
+ "negligee",
+ "negotiator",
+ "neighbor",
+ "neighborhood",
+ "neon",
+ "nephew",
+ "nerd",
+ "nest",
+ "nettle",
+ "neurologist",
+ "neurosurgeon",
+ "neutron",
+ "newlywed",
+ "newscaster",
+ "newspaper",
+ "newspaperman",
+ "newsstand",
+ "nick",
+ "nickel",
+ "niece",
+ "nightcap",
+ "nightclub",
+ "nightdress",
+ "nightgown",
+ "nightie",
+ "nightingale",
+ "nightshirt",
+ "nightstand",
+ "nightstick",
+ "nimbus",
+ "nitrogen",
+ "noble",
+ "nobleman",
+ "nomad",
+ "noodle",
+ "noose",
+ "nose",
+ "notary",
+ "note",
+ "notebook",
+ "notepad",
+ "notice",
+ "noun",
+ "novel",
+ "novelist",
+ "nozzle",
+ "nugget",
+ "nuke",
+ "nunnery",
+ "nurse",
+ "nursemaid",
+ "nursery",
+ "nutmeg",
+ "nutritionist",
+ "nutshell",
+ "nylon",
+ "nymph",
+ "oasis",
+ "obelisk",
+ "object",
+ "oboe",
+ "observatory",
+ "observer",
+ "obsidian",
+ "obstetrician",
+ "ocean",
+ "oceanographer",
+ "odometer",
+ "offering",
+ "office",
+ "officer",
+ "official",
+ "ogre",
+ "oiler",
+ "ointment",
+ "olive",
+ "omelet",
+ "omelette",
+ "onion",
+ "onyx",
+ "ooze",
+ "opal",
+ "opener",
+ "operative",
+ "operator",
+ "ophthalmologist",
+ "opponent",
+ "oracle",
+ "orange",
+ "oratory",
+ "orchard",
+ "orchestra",
+ "orchid",
+ "orderly",
+ "organ",
+ "organism",
+ "organist",
+ "organizer",
+ "ornament",
+ "orphan",
+ "orphanage",
+ "orthodontist",
+ "oscillator",
+ "ostrich",
+ "otter",
+ "outfit",
+ "outhouse",
+ "outlaw",
+ "outlet",
+ "outpost",
+ "oven",
+ "over",
+ "overcoat",
+ "overhang",
+ "overlord",
+ "overpass",
+ "oyster",
+ "pacemaker",
+ "pacifier",
+ "pack",
+ "package",
+ "packer",
+ "packet",
+ "paddle",
+ "paddy",
+ "padlock",
+ "pagan",
+ "page",
+ "pagoda",
+ "pail",
+ "paint",
+ "paintbrush",
+ "painter",
+ "painting",
+ "palace",
+ "palette",
+ "palisade",
+ "palladium",
+ "pallbearer",
+ "pallet",
+ "palm",
+ "pamphlet",
+ "panacea",
+ "pancake",
+ "panda",
+ "pane",
+ "panel",
+ "pansy",
+ "panther",
+ "pantry",
+ "pantsuit",
+ "papa",
+ "papaya",
+ "paper",
+ "paperback",
+ "paperweight",
+ "paprika",
+ "parachute",
+ "paradise",
+ "paraffin",
+ "parakeet",
+ "paramour",
+ "parapet",
+ "parasite",
+ "parasol",
+ "paratrooper",
+ "parcel",
+ "parchment",
+ "parent",
+ "parish",
+ "park",
+ "parka",
+ "parkland",
+ "parkway",
+ "parlor",
+ "parlour",
+ "parrot",
+ "parson",
+ "particle",
+ "particulate",
+ "partition",
+ "partner",
+ "passage",
+ "passageway",
+ "passport",
+ "pasta",
+ "paste",
+ "pastel",
+ "pastor",
+ "pastry",
+ "pasture",
+ "pasty",
+ "patch",
+ "pathologist",
+ "patient",
+ "patio",
+ "patrician",
+ "patriot",
+ "pattern",
+ "pavilion",
+ "peach",
+ "peacock",
+ "peak",
+ "peanut",
+ "pear",
+ "pearl",
+ "peasant",
+ "peat",
+ "pebble",
+ "pecan",
+ "peddler",
+ "pedestal",
+ "pedestrian",
+ "pediatrician",
+ "peel",
+ "pegboard",
+ "pellet",
+ "pelt",
+ "penalty",
+ "pencil",
+ "pendant",
+ "pendulum",
+ "penguin",
+ "penicillin",
+ "penitentiary",
+ "penthouse",
+ "pepper",
+ "peppermint",
+ "pepperoni",
+ "percussion",
+ "percussionist",
+ "perfume",
+ "perimeter",
+ "periodical",
+ "periscope",
+ "permit",
+ "persimmon",
+ "pesticide",
+ "petition",
+ "petticoat",
+ "phaeton",
+ "phantom",
+ "pharaoh",
+ "pharmacist",
+ "pharmacy",
+ "pheasant",
+ "philanthropist",
+ "philosopher",
+ "phone",
+ "phonograph",
+ "photo",
+ "photograph",
+ "photographer",
+ "photon",
+ "physician",
+ "physicist",
+ "physiologist",
+ "pianist",
+ "piazza",
+ "pick",
+ "pickle",
+ "picture",
+ "pier",
+ "pigeon",
+ "piglet",
+ "pilgrim",
+ "pill",
+ "pillar",
+ "pillbox",
+ "pillow",
+ "pilot",
+ "pinafore",
+ "pinball",
+ "pine",
+ "pineapple",
+ "pink",
+ "pinkie",
+ "pinwheel",
+ "pipe",
+ "pipeline",
+ "piper",
+ "pirate",
+ "pistachio",
+ "pistol",
+ "pitch",
+ "pitcher",
+ "pitchfork",
+ "pituitary",
+ "pixie",
+ "pizza",
+ "placard",
+ "plague",
+ "plaid",
+ "plain",
+ "plaintiff",
+ "plan",
+ "plane",
+ "planet",
+ "planetoid",
+ "plank",
+ "plant",
+ "plantain",
+ "plantation",
+ "planter",
+ "plaque",
+ "plasma",
+ "plaster",
+ "plastic",
+ "plate",
+ "plateau",
+ "platform",
+ "platter",
+ "player",
+ "playground",
+ "playgroup",
+ "playhouse",
+ "playpen",
+ "playwright",
+ "plaza",
+ "plough",
+ "plow",
+ "plug",
+ "plum",
+ "plumber",
+ "plume",
+ "plywood",
+ "pocket",
+ "pocketbook",
+ "podium",
+ "poem",
+ "poet",
+ "pointer",
+ "poison",
+ "poke",
+ "poker",
+ "polder",
+ "pole",
+ "policeman",
+ "policewoman",
+ "polish",
+ "politician",
+ "pollution",
+ "polyester",
+ "polygraph",
+ "pomegranate",
+ "pond",
+ "pony",
+ "poodle",
+ "pool",
+ "popcorn",
+ "poplar",
+ "poppy",
+ "porcelain",
+ "porch",
+ "porcupine",
+ "pork",
+ "porpoise",
+ "porridge",
+ "port",
+ "portal",
+ "porter",
+ "portfolio",
+ "porthole",
+ "portico",
+ "portiere",
+ "portrait",
+ "possum",
+ "post",
+ "postcard",
+ "poster",
+ "postman",
+ "postmaster",
+ "potato",
+ "potion",
+ "potpourri",
+ "potter",
+ "pottery",
+ "pouch",
+ "powder",
+ "powerboat",
+ "pragmatist",
+ "prairie",
+ "pram",
+ "preacher",
+ "precinct",
+ "precipice",
+ "predator",
+ "prefect",
+ "prelate",
+ "premier",
+ "present",
+ "presenter",
+ "president",
+ "press",
+ "pretzel",
+ "prey",
+ "priest",
+ "priestess",
+ "primate",
+ "primer",
+ "prince",
+ "princess",
+ "principal",
+ "printer",
+ "prism",
+ "prison",
+ "prisoner",
+ "private",
+ "prize",
+ "prizefighter",
+ "probe",
+ "prod",
+ "prodigy",
+ "produce",
+ "producer",
+ "professional",
+ "professor",
+ "programmer",
+ "projectile",
+ "projectionist",
+ "projector",
+ "proletariat",
+ "prop",
+ "propeller",
+ "prophet",
+ "prosecutor",
+ "protagonist",
+ "protector",
+ "protein",
+ "protester",
+ "proton",
+ "prune",
+ "psychiatrist",
+ "psychoanalyst",
+ "psychologist",
+ "psychopath",
+ "psychotherapist",
+ "publication",
+ "publicist",
+ "publisher",
+ "puck",
+ "pudding",
+ "puddle",
+ "puff",
+ "puke",
+ "pulley",
+ "pullover",
+ "pulpit",
+ "pulsar",
+ "pulse",
+ "pump",
+ "pumpkin",
+ "punch",
+ "punk",
+ "punt",
+ "pupil",
+ "puppet",
+ "puppy",
+ "purgatory",
+ "purveyor",
+ "pushcart",
+ "pusher",
+ "putter",
+ "puzzle",
+ "pylon",
+ "pyramid",
+ "python",
+ "quack",
+ "quagmire",
+ "quark",
+ "quarry",
+ "quarter",
+ "quarterback",
+ "quartermaster",
+ "queen",
+ "quiche",
+ "quicksand",
+ "quill",
+ "quilt",
+ "quince",
+ "quiver",
+ "rabbi",
+ "rabbit",
+ "raccoon",
+ "racehorse",
+ "racer",
+ "rack",
+ "racket",
+ "racquet",
+ "radar",
+ "radiation",
+ "radiator",
+ "radio",
+ "radiologist",
+ "radish",
+ "raft",
+ "rafter",
+ "rail",
+ "railing",
+ "railroad",
+ "rain",
+ "rainbow",
+ "raincoat",
+ "raindrop",
+ "raisin",
+ "rake",
+ "ramp",
+ "rampart",
+ "ranch",
+ "rancher",
+ "range",
+ "ranger",
+ "rapier",
+ "rascal",
+ "raspberry",
+ "ratchet",
+ "ration",
+ "rationalist",
+ "rattle",
+ "rattler",
+ "rattlesnake",
+ "rave",
+ "ravine",
+ "rayon",
+ "razor",
+ "reactor",
+ "realist",
+ "ream",
+ "reaper",
+ "rebel",
+ "receptionist",
+ "recipe",
+ "recliner",
+ "record",
+ "recorder",
+ "redneck",
+ "redoubt",
+ "redwood",
+ "reed",
+ "reef",
+ "referee",
+ "refinery",
+ "reflector",
+ "refractor",
+ "refrigerator",
+ "refuge",
+ "refugee",
+ "refuse",
+ "region",
+ "registrar",
+ "regulator",
+ "relativist",
+ "relic",
+ "relish",
+ "remedy",
+ "remover",
+ "renegade",
+ "rental",
+ "repellent",
+ "replica",
+ "reporter",
+ "repository",
+ "representative",
+ "reptile",
+ "republican",
+ "researcher",
+ "reservoir",
+ "residence",
+ "resident",
+ "residue",
+ "resin",
+ "resort",
+ "respirator",
+ "restaurant",
+ "restaurateur",
+ "restraint",
+ "restroom",
+ "retailer",
+ "retreat",
+ "retriever",
+ "revolver",
+ "reward",
+ "rhinestone",
+ "rhododendron",
+ "ribbon",
+ "rickshaw",
+ "rider",
+ "rifle",
+ "rifleman",
+ "rime",
+ "ring",
+ "ringleader",
+ "ringmaster",
+ "rite",
+ "rival",
+ "river",
+ "riverboat",
+ "rivet",
+ "rivulet",
+ "roach",
+ "road",
+ "roadblock",
+ "roadhouse",
+ "roadway",
+ "roast",
+ "robber",
+ "robe",
+ "robin",
+ "robot",
+ "rock",
+ "rocker",
+ "rocket",
+ "rodent",
+ "rogue",
+ "roll",
+ "roller",
+ "roof",
+ "rook",
+ "room",
+ "rooster",
+ "root",
+ "rope",
+ "rosary",
+ "rose",
+ "rotunda",
+ "rouge",
+ "route",
+ "router",
+ "rowboat",
+ "rower",
+ "royalty",
+ "rubber",
+ "rube",
+ "ruby",
+ "rucksack",
+ "rudder",
+ "ruffian",
+ "ruffle",
+ "ruin",
+ "ruler",
+ "runaway",
+ "runner",
+ "runway",
+ "rust",
+ "saber",
+ "sable",
+ "sabre",
+ "sack",
+ "saddle",
+ "sadness",
+ "safe",
+ "safeguard",
+ "sage",
+ "sail",
+ "sailboat",
+ "sailor",
+ "salad",
+ "salamander",
+ "salami",
+ "salesman",
+ "salesperson",
+ "salon",
+ "salsa",
+ "salt",
+ "salve",
+ "salver",
+ "samovar",
+ "sampler",
+ "sanctuary",
+ "sanctum",
+ "sandal",
+ "sandbag",
+ "sandbox",
+ "sander",
+ "sandstone",
+ "sandwich",
+ "sapling",
+ "sapper",
+ "sapphire",
+ "sardine",
+ "sari",
+ "sash",
+ "satchel",
+ "satellite",
+ "satrap",
+ "satyr",
+ "sauce",
+ "saucer",
+ "sauna",
+ "sausage",
+ "savage",
+ "savanna",
+ "savior",
+ "sawhorse",
+ "saxophone",
+ "saxophonist",
+ "scaffold",
+ "scale",
+ "scallop",
+ "scalp",
+ "scamp",
+ "scanner",
+ "scarecrow",
+ "scarf",
+ "scent",
+ "scepter",
+ "schmuck",
+ "scholar",
+ "school",
+ "schoolhouse",
+ "schoolmarm",
+ "schoolmaster",
+ "schooner",
+ "science",
+ "scientist",
+ "scimitar",
+ "scoop",
+ "scooter",
+ "scope",
+ "score",
+ "scoreboard",
+ "scorecard",
+ "scorpion",
+ "scoundrel",
+ "scout",
+ "scrapbook",
+ "scraper",
+ "screamer",
+ "screenplay",
+ "screenwriter",
+ "screw",
+ "screwdriver",
+ "scribe",
+ "scroll",
+ "scullery",
+ "sculptor",
+ "sculpture",
+ "scythe",
+ "seafood",
+ "seagull",
+ "seal",
+ "seaman",
+ "seamstress",
+ "seaplane",
+ "seaport",
+ "searchlight",
+ "seashell",
+ "seat",
+ "seaweed",
+ "secretary",
+ "security",
+ "sedan",
+ "sedative",
+ "sediment",
+ "seed",
+ "seer",
+ "seesaw",
+ "seismometer",
+ "seller",
+ "semaphore",
+ "seminary",
+ "senator",
+ "sensor",
+ "sentry",
+ "sepulcher",
+ "serf",
+ "sergeant",
+ "serpent",
+ "serum",
+ "servant",
+ "server",
+ "sesame",
+ "settee",
+ "setter",
+ "settler",
+ "sewer",
+ "sextant",
+ "shack",
+ "shade",
+ "shadow",
+ "shake",
+ "sham",
+ "shaman",
+ "shampoo",
+ "shank",
+ "shanty",
+ "shark",
+ "sharpshooter",
+ "shaver",
+ "shawl",
+ "shed",
+ "sheepskin",
+ "sheet",
+ "sheikh",
+ "shelf",
+ "shell",
+ "shelter",
+ "shepherd",
+ "sherbet",
+ "sheriff",
+ "shield",
+ "shift",
+ "shingle",
+ "ship",
+ "shipwreck",
+ "shipwright",
+ "shipyard",
+ "shire",
+ "shirt",
+ "shock",
+ "shoe",
+ "shoemaker",
+ "shoestring",
+ "shoot",
+ "shooter",
+ "shop",
+ "shopkeeper",
+ "shoreline",
+ "shot",
+ "shotgun",
+ "shovel",
+ "show",
+ "shower",
+ "showgirl",
+ "shrew",
+ "shrimp",
+ "shrine",
+ "shroud",
+ "shrub",
+ "shrubbery",
+ "shrug",
+ "shutter",
+ "shuttle",
+ "sickle",
+ "sidearm",
+ "sideboard",
+ "sidecar",
+ "sidewalk",
+ "sidewinder",
+ "sieve",
+ "sign",
+ "signal",
+ "signpost",
+ "silk",
+ "sill",
+ "silver",
+ "singer",
+ "singularity",
+ "sink",
+ "siren",
+ "sirloin",
+ "sister",
+ "sitter",
+ "skate",
+ "skater",
+ "skeleton",
+ "skeptic",
+ "sketch",
+ "skewer",
+ "skier",
+ "skiff",
+ "skillet",
+ "skimmer",
+ "skin",
+ "skipper",
+ "skirt",
+ "skull",
+ "skullcap",
+ "skunk",
+ "skylight",
+ "skyrocket",
+ "skyscraper",
+ "slate",
+ "sledge",
+ "sledgehammer",
+ "sleeper",
+ "sleeve",
+ "sleigh",
+ "slide",
+ "slime",
+ "sling",
+ "slingshot",
+ "slip",
+ "slipper",
+ "sloop",
+ "slop",
+ "slope",
+ "sloth",
+ "slough",
+ "slug",
+ "slugger",
+ "smack",
+ "smile",
+ "smith",
+ "smock",
+ "smoke",
+ "smoker",
+ "smuggler",
+ "snack",
+ "snail",
+ "snake",
+ "snapper",
+ "snare",
+ "sneaker",
+ "sniper",
+ "snob",
+ "snorkel",
+ "snot",
+ "snow",
+ "snowball",
+ "snowflake",
+ "snowman",
+ "snowmobile",
+ "snowplow",
+ "snowshoe",
+ "snowstorm",
+ "soap",
+ "socialist",
+ "socialite",
+ "sociologist",
+ "sock",
+ "socket",
+ "soda",
+ "sofa",
+ "soil",
+ "soldier",
+ "sole",
+ "solicitor",
+ "solution",
+ "song",
+ "songwriter",
+ "soot",
+ "sophomore",
+ "sorbet",
+ "sorcerer",
+ "sore",
+ "sorghum",
+ "sorority",
+ "souffle",
+ "soul",
+ "soup",
+ "sourdough",
+ "souvenir",
+ "sovereign",
+ "soybean",
+ "space",
+ "spaceport",
+ "spaceship",
+ "spacesuit",
+ "spade",
+ "span",
+ "spaniel",
+ "spar",
+ "spark",
+ "sparrow",
+ "spatula",
+ "speaker",
+ "spear",
+ "speck",
+ "spectacle",
+ "spectator",
+ "speechwriter",
+ "speedometer",
+ "sphere",
+ "spice",
+ "spider",
+ "spigot",
+ "spike",
+ "spill",
+ "spindle",
+ "spine",
+ "spinster",
+ "spire",
+ "spirit",
+ "spit",
+ "spitball",
+ "spleen",
+ "sponge",
+ "spool",
+ "spoon",
+ "spore",
+ "sportscaster",
+ "spotlight",
+ "spotter",
+ "spouse",
+ "spout",
+ "spread",
+ "sprig",
+ "spring",
+ "sprinkler",
+ "sprite",
+ "spruce",
+ "spur",
+ "square",
+ "squash",
+ "squatter",
+ "squire",
+ "squirrel",
+ "stable",
+ "stack",
+ "stadium",
+ "stag",
+ "stage",
+ "stagecoach",
+ "stain",
+ "staircase",
+ "stairway",
+ "stairwell",
+ "stake",
+ "stall",
+ "stallion",
+ "stamp",
+ "stand",
+ "standard",
+ "staple",
+ "star",
+ "starch",
+ "starling",
+ "starship",
+ "stateroom",
+ "station",
+ "statistician",
+ "statue",
+ "statuette",
+ "stave",
+ "steak",
+ "steam",
+ "steamboat",
+ "steamer",
+ "steamship",
+ "steed",
+ "steel",
+ "steeple",
+ "steer",
+ "stele",
+ "stem",
+ "stenographer",
+ "stepladder",
+ "steppe",
+ "stereo",
+ "stethoscope",
+ "stevedore",
+ "stew",
+ "steward",
+ "stewardess",
+ "stick",
+ "sticker",
+ "still",
+ "stilt",
+ "stinger",
+ "stinker",
+ "stint",
+ "stirrup",
+ "stock",
+ "stockade",
+ "stockroom",
+ "stockyard",
+ "stole",
+ "stone",
+ "stoneware",
+ "stool",
+ "stoop",
+ "stopper",
+ "stopwatch",
+ "store",
+ "storehouse",
+ "stork",
+ "storm",
+ "story",
+ "storyboard",
+ "stove",
+ "straitjacket",
+ "straw",
+ "strawberry",
+ "stream",
+ "streamer",
+ "street",
+ "streetcar",
+ "stretcher",
+ "string",
+ "stroller",
+ "strongbox",
+ "stronghold",
+ "strudel",
+ "stud",
+ "student",
+ "studio",
+ "study",
+ "stuff",
+ "stump",
+ "stunner",
+ "sturgeon",
+ "stylist",
+ "stylus",
+ "submarine",
+ "subpoena",
+ "suburb",
+ "subway",
+ "sucker",
+ "suede",
+ "sugar",
+ "suit",
+ "suitcase",
+ "suite",
+ "sulfur",
+ "sultan",
+ "sunbeam",
+ "sundae",
+ "sunflower",
+ "superhighway",
+ "superintendent",
+ "supermarket",
+ "supernova",
+ "superstar",
+ "superstructure",
+ "supervisor",
+ "supply",
+ "support",
+ "supporter",
+ "surcoat",
+ "surface",
+ "surfboard",
+ "surfer",
+ "surgeon",
+ "surveyor",
+ "suspect",
+ "swallow",
+ "swampland",
+ "swan",
+ "swarm",
+ "sweat",
+ "sweater",
+ "sweatshirt",
+ "sweeper",
+ "sweet",
+ "sweetener",
+ "sweetheart",
+ "swimmer",
+ "swimsuit",
+ "swing",
+ "switch",
+ "switchblade",
+ "switchboard",
+ "swivel",
+ "sword",
+ "sycamore",
+ "sycophant",
+ "synagogue",
+ "synthesizer",
+ "syringe",
+ "syrup",
+ "tabby",
+ "tabernacle",
+ "table",
+ "tablecloth",
+ "tablespoon",
+ "tablet",
+ "tableware",
+ "tack",
+ "tail",
+ "tailor",
+ "talc",
+ "talon",
+ "tamale",
+ "tambourine",
+ "tang",
+ "tank",
+ "tankard",
+ "tanker",
+ "tape",
+ "taper",
+ "tapestry",
+ "tarantula",
+ "target",
+ "tarp",
+ "tarpaulin",
+ "tart",
+ "tassel",
+ "tattoo",
+ "taxi",
+ "taxicab",
+ "teacher",
+ "teacup",
+ "teakettle",
+ "teammate",
+ "teamster",
+ "teapot",
+ "teaspoon",
+ "technician",
+ "technocrat",
+ "technology",
+ "teddy",
+ "teen",
+ "telegraph",
+ "telephone",
+ "telescope",
+ "television",
+ "teller",
+ "tempest",
+ "temple",
+ "tender",
+ "tendril",
+ "tenor",
+ "tent",
+ "tentacle",
+ "tepee",
+ "terminal",
+ "tern",
+ "terrace",
+ "terrier",
+ "territory",
+ "terrorist",
+ "text",
+ "textbook",
+ "textile",
+ "theater",
+ "theatre",
+ "theologian",
+ "therapist",
+ "thermometer",
+ "thermostat",
+ "thesis",
+ "thicket",
+ "thief",
+ "thimble",
+ "thing",
+ "thistle",
+ "thong",
+ "thorax",
+ "thorn",
+ "thoroughbred",
+ "thread",
+ "throne",
+ "throw",
+ "thrush",
+ "thug",
+ "thunder",
+ "thunderbolt",
+ "thunderstorm",
+ "thyme",
+ "tiara",
+ "tibia",
+ "tick",
+ "ticket",
+ "tiger",
+ "tile",
+ "tiller",
+ "timber",
+ "timberland",
+ "timer",
+ "tine",
+ "tinker",
+ "tipper",
+ "tissue",
+ "titan",
+ "toad",
+ "toast",
+ "toaster",
+ "toboggan",
+ "toddler",
+ "toenail",
+ "toffee",
+ "toga",
+ "toilet",
+ "token",
+ "tomahawk",
+ "tomato",
+ "tomb",
+ "tombstone",
+ "tomcat",
+ "tome",
+ "tong",
+ "tongue",
+ "tonic",
+ "tool",
+ "toolbox",
+ "tooth",
+ "toothbrush",
+ "toothpaste",
+ "toothpick",
+ "topcoat",
+ "torch",
+ "tornado",
+ "torpedo",
+ "torte",
+ "tortilla",
+ "tortoise",
+ "tote",
+ "totem",
+ "toupee",
+ "tourniquet",
+ "towel",
+ "tower",
+ "town",
+ "townhouse",
+ "toxicologist",
+ "toxin",
+ "tracer",
+ "track",
+ "tract",
+ "tractor",
+ "trader",
+ "tradesman",
+ "trailer",
+ "train",
+ "trainer",
+ "traitor",
+ "tram",
+ "tramp",
+ "trampoline",
+ "tranquilizer",
+ "transfer",
+ "transformer",
+ "transistor",
+ "translator",
+ "transmitter",
+ "transport",
+ "trap",
+ "trapdoor",
+ "trapeze",
+ "trapper",
+ "traveler",
+ "trawler",
+ "tray",
+ "tread",
+ "treadmill",
+ "treasure",
+ "treasurer",
+ "treasury",
+ "treat",
+ "trench",
+ "trespasser",
+ "triangle",
+ "tribesman",
+ "tribunal",
+ "tributary",
+ "tribute",
+ "trickster",
+ "tricycle",
+ "trifle",
+ "trinket",
+ "tripe",
+ "tripod",
+ "troika",
+ "troll",
+ "trolley",
+ "trombone",
+ "trombonist",
+ "troop",
+ "trooper",
+ "trophy",
+ "trough",
+ "trowel",
+ "truck",
+ "trucker",
+ "trumpet",
+ "trumpeter",
+ "truncheon",
+ "trunk",
+ "truss",
+ "tsar",
+ "tuba",
+ "tube",
+ "tuber",
+ "tugboat",
+ "tulip",
+ "tumbler",
+ "tumbleweed",
+ "tumor",
+ "tundra",
+ "tuner",
+ "tunic",
+ "tunnel",
+ "turban",
+ "turbine",
+ "turkey",
+ "turncoat",
+ "turnip",
+ "turnover",
+ "turnpike",
+ "turnstile",
+ "turntable",
+ "turquoise",
+ "turret",
+ "turtle",
+ "turtleneck",
+ "tusk",
+ "tutor",
+ "tutu",
+ "tuxedo",
+ "tweed",
+ "tween",
+ "twig",
+ "twilight",
+ "twill",
+ "twin",
+ "twine",
+ "twister",
+ "tycoon",
+ "typewriter",
+ "typist",
+ "tyrant",
+ "umber",
+ "umbrella",
+ "umpire",
+ "uncle",
+ "undergarment",
+ "undergraduate",
+ "underground",
+ "underpass",
+ "undershirt",
+ "undertaker",
+ "underwear",
+ "underwriter",
+ "unicorn",
+ "uniform",
+ "universe",
+ "university",
+ "urchin",
+ "urinal",
+ "urologist",
+ "usher",
+ "vaccine",
+ "vagabond",
+ "valedictorian",
+ "valentine",
+ "valet",
+ "valley",
+ "valve",
+ "vampire",
+ "vandal",
+ "vapor",
+ "vase",
+ "vault",
+ "veal",
+ "vegetable",
+ "vegetarian",
+ "vehicle",
+ "veil",
+ "velour",
+ "velvet",
+ "veneer",
+ "venom",
+ "vent",
+ "ventilator",
+ "ventriloquist",
+ "venue",
+ "veranda",
+ "vertebra",
+ "vessel",
+ "vest",
+ "veteran",
+ "veterinarian",
+ "vial",
+ "vicar",
+ "vice",
+ "victory",
+ "video",
+ "villa",
+ "village",
+ "villager",
+ "villain",
+ "vine",
+ "vinegar",
+ "vineyard",
+ "vinyl",
+ "violet",
+ "violin",
+ "violinist",
+ "viper",
+ "virgin",
+ "vise",
+ "visitor",
+ "visor",
+ "vitamin",
+ "vocalist",
+ "void",
+ "volcano",
+ "volleyball",
+ "vomit",
+ "vortex",
+ "voucher",
+ "vulture",
+ "wafer",
+ "waffle",
+ "wagon",
+ "waistcoat",
+ "waiter",
+ "waitress",
+ "walker",
+ "wall",
+ "wallet",
+ "walleye",
+ "wallpaper",
+ "walnut",
+ "wand",
+ "warbler",
+ "warden",
+ "wardrobe",
+ "warehouse",
+ "warlord",
+ "warranty",
+ "warrior",
+ "warship",
+ "washbasin",
+ "washboard",
+ "washcloth",
+ "washer",
+ "wasp",
+ "waste",
+ "wastebasket",
+ "wasteland",
+ "watch",
+ "watchtower",
+ "water",
+ "waterfall",
+ "watermelon",
+ "wattle",
+ "wave",
+ "weapon",
+ "weasel",
+ "weatherman",
+ "weave",
+ "weaver",
+ "wedge",
+ "weed",
+ "weight",
+ "welder",
+ "well",
+ "wellspring",
+ "werewolf",
+ "whale",
+ "whaler",
+ "wharf",
+ "wheat",
+ "wheel",
+ "wheelbarrow",
+ "wheelchair",
+ "whelp",
+ "whiff",
+ "whip",
+ "whirlpool",
+ "whirlwind",
+ "whisk",
+ "whisker",
+ "whiskey",
+ "whisky",
+ "whistle",
+ "wicket",
+ "widow",
+ "wife",
+ "wigwam",
+ "wildcat",
+ "wilderness",
+ "willow",
+ "winch",
+ "wind",
+ "windbreaker",
+ "windmill",
+ "window",
+ "windowsill",
+ "winery",
+ "wipe",
+ "wire",
+ "wishbone",
+ "wisp",
+ "witch",
+ "wizard",
+ "wolf",
+ "woman",
+ "wonderland",
+ "wood",
+ "woodchuck",
+ "woodcutter",
+ "woodland",
+ "woodpecker",
+ "woodworker",
+ "wool",
+ "word",
+ "workbench",
+ "worker",
+ "workhouse",
+ "workplace",
+ "workroom",
+ "workshop",
+ "workstation",
+ "world",
+ "worm",
+ "wraith",
+ "wrapper",
+ "wreath",
+ "wrecker",
+ "wren",
+ "wrench",
+ "wrestler",
+ "wrinkle",
+ "wrist",
+ "writ",
+ "writer",
+ "wyrm",
+ "yacht",
+ "yard",
+ "yardstick",
+ "yarmulke",
+ "yarn",
+ "yeast",
+ "yeoman",
+ "yogurt",
+ "yoke",
+ "yolk",
+ "zebra",
+ "zipper",
+ "zombie",
+ "zone",
+ "zoologist",
+ "zygote",
}
diff --git a/vendor/github.com/Luzifer/go_helpers/LICENSE b/vendor/github.com/Luzifer/go_helpers/LICENSE
deleted file mode 100644
index bb0cb94..0000000
--- a/vendor/github.com/Luzifer/go_helpers/LICENSE
+++ /dev/null
@@ -1,202 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright 2016- Knut Ahlers
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
-
diff --git a/vendor/github.com/Luzifer/go_helpers/accessLogger/accessLogger.go b/vendor/github.com/Luzifer/go_helpers/accessLogger/accessLogger.go
deleted file mode 100644
index b800a68..0000000
--- a/vendor/github.com/Luzifer/go_helpers/accessLogger/accessLogger.go
+++ /dev/null
@@ -1,37 +0,0 @@
-package accessLogger
-
-import (
- "fmt"
- "net/http"
- "strconv"
-)
-
-type AccessLogResponseWriter struct {
- StatusCode int
- Size int
-
- http.ResponseWriter
-}
-
-func New(res http.ResponseWriter) *AccessLogResponseWriter {
- return &AccessLogResponseWriter{
- StatusCode: 200,
- Size: 0,
- ResponseWriter: res,
- }
-}
-
-func (a *AccessLogResponseWriter) Write(out []byte) (int, error) {
- s, err := a.ResponseWriter.Write(out)
- a.Size += s
- return s, err
-}
-
-func (a *AccessLogResponseWriter) WriteHeader(code int) {
- a.StatusCode = code
- a.ResponseWriter.WriteHeader(code)
-}
-
-func (a *AccessLogResponseWriter) HTTPResponseType() string {
- return fmt.Sprintf("%cxx", strconv.FormatInt(int64(a.StatusCode), 10)[0])
-}
diff --git a/vendor/github.com/Luzifer/go_helpers/http/digest.go b/vendor/github.com/Luzifer/go_helpers/http/digest.go
deleted file mode 100644
index 40cc5aa..0000000
--- a/vendor/github.com/Luzifer/go_helpers/http/digest.go
+++ /dev/null
@@ -1,55 +0,0 @@
-package http
-
-import (
- "crypto/md5"
- "crypto/rand"
- "encoding/hex"
- "fmt"
- "io"
- "net/http"
- "strings"
-
- "github.com/Luzifer/go_helpers/str"
-)
-
-func GetDigestAuth(resp *http.Response, method, requestPath, user, password string) string {
- params := map[string]string{}
- for _, part := range strings.Split(resp.Header.Get("Www-Authenticate"), " ") {
- if !strings.Contains(part, `="`) {
- continue
- }
- spl := strings.Split(strings.Trim(part, " ,"), "=")
- if !str.StringInSlice(spl[0], []string{"nonce", "realm", "qop"}) {
- continue
- }
- params[spl[0]] = strings.Trim(spl[1], `"`)
- }
-
- b := make([]byte, 8)
- io.ReadFull(rand.Reader, b)
-
- params["cnonce"] = fmt.Sprintf("%x", b)
- params["nc"] = "1"
- params["uri"] = requestPath
- params["username"] = user
- params["response"] = getMD5([]string{
- getMD5([]string{params["username"], params["realm"], password}),
- params["nonce"],
- params["nc"],
- params["cnonce"],
- params["qop"],
- getMD5([]string{method, requestPath}),
- })
-
- authParts := []string{}
- for k, v := range params {
- authParts = append(authParts, fmt.Sprintf("%s=%q", k, v))
- }
- return "Digest " + strings.Join(authParts, ", ")
-}
-
-func getMD5(in []string) string {
- h := md5.New()
- h.Write([]byte(strings.Join(in, ":")))
- return hex.EncodeToString(h.Sum(nil))
-}
diff --git a/vendor/github.com/Luzifer/go_helpers/http/gzip.go b/vendor/github.com/Luzifer/go_helpers/http/gzip.go
deleted file mode 100644
index d15b74b..0000000
--- a/vendor/github.com/Luzifer/go_helpers/http/gzip.go
+++ /dev/null
@@ -1,47 +0,0 @@
-package http
-
-import (
- "compress/gzip"
- "io"
- "net/http"
- "strings"
-)
-
-type gzipResponseWriter struct {
- io.Writer
- http.ResponseWriter
-}
-
-func (w gzipResponseWriter) Write(b []byte) (int, error) {
- return w.Writer.Write(b)
-}
-
-// GzipHandler wraps an http.Handler and gzips responses if the client supports it
-func GzipHandler(handler http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
- handler.ServeHTTP(w, r)
- return
- }
- w.Header().Set("Content-Encoding", "gzip")
- gz := gzip.NewWriter(w)
- defer gz.Close()
- gzw := gzipResponseWriter{Writer: gz, ResponseWriter: w}
- handler.ServeHTTP(gzw, r)
- })
-}
-
-// GzipFunc wraps an http.HandlerFunc and gzips responses if the client supports it
-func GzipFunc(f http.HandlerFunc) http.HandlerFunc {
- return func(w http.ResponseWriter, r *http.Request) {
- if !strings.Contains(r.Header.Get("Accept-Encoding"), "gzip") {
- f(w, r)
- return
- }
- w.Header().Set("Content-Encoding", "gzip")
- gz := gzip.NewWriter(w)
- defer gz.Close()
- gzw := gzipResponseWriter{Writer: gz, ResponseWriter: w}
- f(gzw, r)
- }
-}
diff --git a/vendor/github.com/Luzifer/go_helpers/http/logHandler.go b/vendor/github.com/Luzifer/go_helpers/http/logHandler.go
deleted file mode 100644
index 4554e74..0000000
--- a/vendor/github.com/Luzifer/go_helpers/http/logHandler.go
+++ /dev/null
@@ -1,57 +0,0 @@
-package http
-
-import (
- "log"
- "net/http"
- "strings"
- "time"
-
- "github.com/Luzifer/go_helpers/accessLogger"
-)
-
-type HTTPLogHandler struct {
- Handler http.Handler
- TrustedIPHeaders []string
-}
-
-func NewHTTPLogHandler(h http.Handler) http.Handler {
- return HTTPLogHandler{
- Handler: h,
- TrustedIPHeaders: []string{"X-Forwarded-For", "RemoteAddr", "X-Real-IP"},
- }
-}
-
-func (l HTTPLogHandler) ServeHTTP(res http.ResponseWriter, r *http.Request) {
- start := time.Now()
- ares := accessLogger.New(res)
-
- l.Handler.ServeHTTP(ares, r)
-
- path := r.URL.Path
- if q := r.URL.Query().Encode(); len(q) > 0 {
- path = path + "?" + q
- }
-
- log.Printf("%s - \"%s %s\" %d %d \"%s\" \"%s\" %s",
- l.findIP(r),
- r.Method,
- path,
- ares.StatusCode,
- ares.Size,
- r.Header.Get("Referer"),
- r.Header.Get("User-Agent"),
- time.Since(start),
- )
-}
-
-func (l HTTPLogHandler) findIP(r *http.Request) string {
- remoteAddr := strings.SplitN(r.RemoteAddr, ":", 2)[0]
-
- for _, hdr := range l.TrustedIPHeaders {
- if value := r.Header.Get(hdr); value != "" {
- return strings.SplitN(value, ",", 2)[0]
- }
- }
-
- return remoteAddr
-}
diff --git a/vendor/github.com/Luzifer/go_helpers/str/slice.go b/vendor/github.com/Luzifer/go_helpers/str/slice.go
deleted file mode 100644
index f93af69..0000000
--- a/vendor/github.com/Luzifer/go_helpers/str/slice.go
+++ /dev/null
@@ -1,21 +0,0 @@
-package str
-
-// AppendIfMissing adds a string to a slice when it's not present yet
-func AppendIfMissing(slice []string, s string) []string {
- for _, e := range slice {
- if e == s {
- return slice
- }
- }
- return append(slice, s)
-}
-
-// StringInSlice checks for the existence of a string in the slice
-func StringInSlice(a string, list []string) bool {
- for _, b := range list {
- if b == a {
- return true
- }
- }
- return false
-}
diff --git a/vendor/github.com/gorilla/context/LICENSE b/vendor/github.com/gorilla/context/LICENSE
deleted file mode 100644
index 0e5fb87..0000000
--- a/vendor/github.com/gorilla/context/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/gorilla/context/context.go b/vendor/github.com/gorilla/context/context.go
deleted file mode 100644
index 81cb128..0000000
--- a/vendor/github.com/gorilla/context/context.go
+++ /dev/null
@@ -1,143 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package context
-
-import (
- "net/http"
- "sync"
- "time"
-)
-
-var (
- mutex sync.RWMutex
- data = make(map[*http.Request]map[interface{}]interface{})
- datat = make(map[*http.Request]int64)
-)
-
-// Set stores a value for a given key in a given request.
-func Set(r *http.Request, key, val interface{}) {
- mutex.Lock()
- if data[r] == nil {
- data[r] = make(map[interface{}]interface{})
- datat[r] = time.Now().Unix()
- }
- data[r][key] = val
- mutex.Unlock()
-}
-
-// Get returns a value stored for a given key in a given request.
-func Get(r *http.Request, key interface{}) interface{} {
- mutex.RLock()
- if ctx := data[r]; ctx != nil {
- value := ctx[key]
- mutex.RUnlock()
- return value
- }
- mutex.RUnlock()
- return nil
-}
-
-// GetOk returns stored value and presence state like multi-value return of map access.
-func GetOk(r *http.Request, key interface{}) (interface{}, bool) {
- mutex.RLock()
- if _, ok := data[r]; ok {
- value, ok := data[r][key]
- mutex.RUnlock()
- return value, ok
- }
- mutex.RUnlock()
- return nil, false
-}
-
-// GetAll returns all stored values for the request as a map. Nil is returned for invalid requests.
-func GetAll(r *http.Request) map[interface{}]interface{} {
- mutex.RLock()
- if context, ok := data[r]; ok {
- result := make(map[interface{}]interface{}, len(context))
- for k, v := range context {
- result[k] = v
- }
- mutex.RUnlock()
- return result
- }
- mutex.RUnlock()
- return nil
-}
-
-// GetAllOk returns all stored values for the request as a map and a boolean value that indicates if
-// the request was registered.
-func GetAllOk(r *http.Request) (map[interface{}]interface{}, bool) {
- mutex.RLock()
- context, ok := data[r]
- result := make(map[interface{}]interface{}, len(context))
- for k, v := range context {
- result[k] = v
- }
- mutex.RUnlock()
- return result, ok
-}
-
-// Delete removes a value stored for a given key in a given request.
-func Delete(r *http.Request, key interface{}) {
- mutex.Lock()
- if data[r] != nil {
- delete(data[r], key)
- }
- mutex.Unlock()
-}
-
-// Clear removes all values stored for a given request.
-//
-// This is usually called by a handler wrapper to clean up request
-// variables at the end of a request lifetime. See ClearHandler().
-func Clear(r *http.Request) {
- mutex.Lock()
- clear(r)
- mutex.Unlock()
-}
-
-// clear is Clear without the lock.
-func clear(r *http.Request) {
- delete(data, r)
- delete(datat, r)
-}
-
-// Purge removes request data stored for longer than maxAge, in seconds.
-// It returns the amount of requests removed.
-//
-// If maxAge <= 0, all request data is removed.
-//
-// This is only used for sanity check: in case context cleaning was not
-// properly set some request data can be kept forever, consuming an increasing
-// amount of memory. In case this is detected, Purge() must be called
-// periodically until the problem is fixed.
-func Purge(maxAge int) int {
- mutex.Lock()
- count := 0
- if maxAge <= 0 {
- count = len(data)
- data = make(map[*http.Request]map[interface{}]interface{})
- datat = make(map[*http.Request]int64)
- } else {
- min := time.Now().Unix() - int64(maxAge)
- for r := range data {
- if datat[r] < min {
- clear(r)
- count++
- }
- }
- }
- mutex.Unlock()
- return count
-}
-
-// ClearHandler wraps an http.Handler and clears request values at the end
-// of a request lifetime.
-func ClearHandler(h http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- defer Clear(r)
- h.ServeHTTP(w, r)
- })
-}
diff --git a/vendor/github.com/gorilla/context/doc.go b/vendor/github.com/gorilla/context/doc.go
deleted file mode 100644
index 448d1bf..0000000
--- a/vendor/github.com/gorilla/context/doc.go
+++ /dev/null
@@ -1,88 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Package context stores values shared during a request lifetime.
-
-Note: gorilla/context, having been born well before `context.Context` existed,
-does not play well > with the shallow copying of the request that
-[`http.Request.WithContext`](https://golang.org/pkg/net/http/#Request.WithContext)
-(added to net/http Go 1.7 onwards) performs. You should either use *just*
-gorilla/context, or moving forward, the new `http.Request.Context()`.
-
-For example, a router can set variables extracted from the URL and later
-application handlers can access those values, or it can be used to store
-sessions values to be saved at the end of a request. There are several
-others common uses.
-
-The idea was posted by Brad Fitzpatrick to the go-nuts mailing list:
-
- http://groups.google.com/group/golang-nuts/msg/e2d679d303aa5d53
-
-Here's the basic usage: first define the keys that you will need. The key
-type is interface{} so a key can be of any type that supports equality.
-Here we define a key using a custom int type to avoid name collisions:
-
- package foo
-
- import (
- "github.com/gorilla/context"
- )
-
- type key int
-
- const MyKey key = 0
-
-Then set a variable. Variables are bound to an http.Request object, so you
-need a request instance to set a value:
-
- context.Set(r, MyKey, "bar")
-
-The application can later access the variable using the same key you provided:
-
- func MyHandler(w http.ResponseWriter, r *http.Request) {
- // val is "bar".
- val := context.Get(r, foo.MyKey)
-
- // returns ("bar", true)
- val, ok := context.GetOk(r, foo.MyKey)
- // ...
- }
-
-And that's all about the basic usage. We discuss some other ideas below.
-
-Any type can be stored in the context. To enforce a given type, make the key
-private and wrap Get() and Set() to accept and return values of a specific
-type:
-
- type key int
-
- const mykey key = 0
-
- // GetMyKey returns a value for this package from the request values.
- func GetMyKey(r *http.Request) SomeType {
- if rv := context.Get(r, mykey); rv != nil {
- return rv.(SomeType)
- }
- return nil
- }
-
- // SetMyKey sets a value for this package in the request values.
- func SetMyKey(r *http.Request, val SomeType) {
- context.Set(r, mykey, val)
- }
-
-Variables must be cleared at the end of a request, to remove all values
-that were stored. This can be done in an http.Handler, after a request was
-served. Just call Clear() passing the request:
-
- context.Clear(r)
-
-...or use ClearHandler(), which conveniently wraps an http.Handler to clear
-variables at the end of a request lifetime.
-
-The Routers from the packages gorilla/mux and gorilla/pat call Clear()
-so if you are using either of them you don't need to clear the context manually.
-*/
-package context
diff --git a/vendor/github.com/gorilla/mux/LICENSE b/vendor/github.com/gorilla/mux/LICENSE
deleted file mode 100644
index 0e5fb87..0000000
--- a/vendor/github.com/gorilla/mux/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2012 Rodrigo Moraes. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/gorilla/mux/context_gorilla.go b/vendor/github.com/gorilla/mux/context_gorilla.go
deleted file mode 100644
index d7adaa8..0000000
--- a/vendor/github.com/gorilla/mux/context_gorilla.go
+++ /dev/null
@@ -1,26 +0,0 @@
-// +build !go1.7
-
-package mux
-
-import (
- "net/http"
-
- "github.com/gorilla/context"
-)
-
-func contextGet(r *http.Request, key interface{}) interface{} {
- return context.Get(r, key)
-}
-
-func contextSet(r *http.Request, key, val interface{}) *http.Request {
- if val == nil {
- return r
- }
-
- context.Set(r, key, val)
- return r
-}
-
-func contextClear(r *http.Request) {
- context.Clear(r)
-}
diff --git a/vendor/github.com/gorilla/mux/context_native.go b/vendor/github.com/gorilla/mux/context_native.go
deleted file mode 100644
index 209cbea..0000000
--- a/vendor/github.com/gorilla/mux/context_native.go
+++ /dev/null
@@ -1,24 +0,0 @@
-// +build go1.7
-
-package mux
-
-import (
- "context"
- "net/http"
-)
-
-func contextGet(r *http.Request, key interface{}) interface{} {
- return r.Context().Value(key)
-}
-
-func contextSet(r *http.Request, key, val interface{}) *http.Request {
- if val == nil {
- return r
- }
-
- return r.WithContext(context.WithValue(r.Context(), key, val))
-}
-
-func contextClear(r *http.Request) {
- return
-}
diff --git a/vendor/github.com/gorilla/mux/doc.go b/vendor/github.com/gorilla/mux/doc.go
deleted file mode 100644
index 38957de..0000000
--- a/vendor/github.com/gorilla/mux/doc.go
+++ /dev/null
@@ -1,306 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Package mux implements a request router and dispatcher.
-
-The name mux stands for "HTTP request multiplexer". Like the standard
-http.ServeMux, mux.Router matches incoming requests against a list of
-registered routes and calls a handler for the route that matches the URL
-or other conditions. The main features are:
-
- * Requests can be matched based on URL host, path, path prefix, schemes,
- header and query values, HTTP methods or using custom matchers.
- * URL hosts, paths and query values can have variables with an optional
- regular expression.
- * Registered URLs can be built, or "reversed", which helps maintaining
- references to resources.
- * Routes can be used as subrouters: nested routes are only tested if the
- parent route matches. This is useful to define groups of routes that
- share common conditions like a host, a path prefix or other repeated
- attributes. As a bonus, this optimizes request matching.
- * It implements the http.Handler interface so it is compatible with the
- standard http.ServeMux.
-
-Let's start registering a couple of URL paths and handlers:
-
- func main() {
- r := mux.NewRouter()
- r.HandleFunc("/", HomeHandler)
- r.HandleFunc("/products", ProductsHandler)
- r.HandleFunc("/articles", ArticlesHandler)
- http.Handle("/", r)
- }
-
-Here we register three routes mapping URL paths to handlers. This is
-equivalent to how http.HandleFunc() works: if an incoming request URL matches
-one of the paths, the corresponding handler is called passing
-(http.ResponseWriter, *http.Request) as parameters.
-
-Paths can have variables. They are defined using the format {name} or
-{name:pattern}. If a regular expression pattern is not defined, the matched
-variable will be anything until the next slash. For example:
-
- r := mux.NewRouter()
- r.HandleFunc("/products/{key}", ProductHandler)
- r.HandleFunc("/articles/{category}/", ArticlesCategoryHandler)
- r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler)
-
-Groups can be used inside patterns, as long as they are non-capturing (?:re). For example:
-
- r.HandleFunc("/articles/{category}/{sort:(?:asc|desc|new)}", ArticlesCategoryHandler)
-
-The names are used to create a map of route variables which can be retrieved
-calling mux.Vars():
-
- vars := mux.Vars(request)
- category := vars["category"]
-
-Note that if any capturing groups are present, mux will panic() during parsing. To prevent
-this, convert any capturing groups to non-capturing, e.g. change "/{sort:(asc|desc)}" to
-"/{sort:(?:asc|desc)}". This is a change from prior versions which behaved unpredictably
-when capturing groups were present.
-
-And this is all you need to know about the basic usage. More advanced options
-are explained below.
-
-Routes can also be restricted to a domain or subdomain. Just define a host
-pattern to be matched. They can also have variables:
-
- r := mux.NewRouter()
- // Only matches if domain is "www.example.com".
- r.Host("www.example.com")
- // Matches a dynamic subdomain.
- r.Host("{subdomain:[a-z]+}.domain.com")
-
-There are several other matchers that can be added. To match path prefixes:
-
- r.PathPrefix("/products/")
-
-...or HTTP methods:
-
- r.Methods("GET", "POST")
-
-...or URL schemes:
-
- r.Schemes("https")
-
-...or header values:
-
- r.Headers("X-Requested-With", "XMLHttpRequest")
-
-...or query values:
-
- r.Queries("key", "value")
-
-...or to use a custom matcher function:
-
- r.MatcherFunc(func(r *http.Request, rm *RouteMatch) bool {
- return r.ProtoMajor == 0
- })
-
-...and finally, it is possible to combine several matchers in a single route:
-
- r.HandleFunc("/products", ProductsHandler).
- Host("www.example.com").
- Methods("GET").
- Schemes("http")
-
-Setting the same matching conditions again and again can be boring, so we have
-a way to group several routes that share the same requirements.
-We call it "subrouting".
-
-For example, let's say we have several URLs that should only match when the
-host is "www.example.com". Create a route for that host and get a "subrouter"
-from it:
-
- r := mux.NewRouter()
- s := r.Host("www.example.com").Subrouter()
-
-Then register routes in the subrouter:
-
- s.HandleFunc("/products/", ProductsHandler)
- s.HandleFunc("/products/{key}", ProductHandler)
- s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler)
-
-The three URL paths we registered above will only be tested if the domain is
-"www.example.com", because the subrouter is tested first. This is not
-only convenient, but also optimizes request matching. You can create
-subrouters combining any attribute matchers accepted by a route.
-
-Subrouters can be used to create domain or path "namespaces": you define
-subrouters in a central place and then parts of the app can register its
-paths relatively to a given subrouter.
-
-There's one more thing about subroutes. When a subrouter has a path prefix,
-the inner routes use it as base for their paths:
-
- r := mux.NewRouter()
- s := r.PathPrefix("/products").Subrouter()
- // "/products/"
- s.HandleFunc("/", ProductsHandler)
- // "/products/{key}/"
- s.HandleFunc("/{key}/", ProductHandler)
- // "/products/{key}/details"
- s.HandleFunc("/{key}/details", ProductDetailsHandler)
-
-Note that the path provided to PathPrefix() represents a "wildcard": calling
-PathPrefix("/static/").Handler(...) means that the handler will be passed any
-request that matches "/static/*". This makes it easy to serve static files with mux:
-
- func main() {
- var dir string
-
- flag.StringVar(&dir, "dir", ".", "the directory to serve files from. Defaults to the current dir")
- flag.Parse()
- r := mux.NewRouter()
-
- // This will serve files under http://localhost:8000/static/
- r.PathPrefix("/static/").Handler(http.StripPrefix("/static/", http.FileServer(http.Dir(dir))))
-
- srv := &http.Server{
- Handler: r,
- Addr: "127.0.0.1:8000",
- // Good practice: enforce timeouts for servers you create!
- WriteTimeout: 15 * time.Second,
- ReadTimeout: 15 * time.Second,
- }
-
- log.Fatal(srv.ListenAndServe())
- }
-
-Now let's see how to build registered URLs.
-
-Routes can be named. All routes that define a name can have their URLs built,
-or "reversed". We define a name calling Name() on a route. For example:
-
- r := mux.NewRouter()
- r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler).
- Name("article")
-
-To build a URL, get the route and call the URL() method, passing a sequence of
-key/value pairs for the route variables. For the previous route, we would do:
-
- url, err := r.Get("article").URL("category", "technology", "id", "42")
-
-...and the result will be a url.URL with the following path:
-
- "/articles/technology/42"
-
-This also works for host and query value variables:
-
- r := mux.NewRouter()
- r.Host("{subdomain}.domain.com").
- Path("/articles/{category}/{id:[0-9]+}").
- Queries("filter", "{filter}").
- HandlerFunc(ArticleHandler).
- Name("article")
-
- // url.String() will be "http://news.domain.com/articles/technology/42?filter=gorilla"
- url, err := r.Get("article").URL("subdomain", "news",
- "category", "technology",
- "id", "42",
- "filter", "gorilla")
-
-All variables defined in the route are required, and their values must
-conform to the corresponding patterns. These requirements guarantee that a
-generated URL will always match a registered route -- the only exception is
-for explicitly defined "build-only" routes which never match.
-
-Regex support also exists for matching Headers within a route. For example, we could do:
-
- r.HeadersRegexp("Content-Type", "application/(text|json)")
-
-...and the route will match both requests with a Content-Type of `application/json` as well as
-`application/text`
-
-There's also a way to build only the URL host or path for a route:
-use the methods URLHost() or URLPath() instead. For the previous route,
-we would do:
-
- // "http://news.domain.com/"
- host, err := r.Get("article").URLHost("subdomain", "news")
-
- // "/articles/technology/42"
- path, err := r.Get("article").URLPath("category", "technology", "id", "42")
-
-And if you use subrouters, host and path defined separately can be built
-as well:
-
- r := mux.NewRouter()
- s := r.Host("{subdomain}.domain.com").Subrouter()
- s.Path("/articles/{category}/{id:[0-9]+}").
- HandlerFunc(ArticleHandler).
- Name("article")
-
- // "http://news.domain.com/articles/technology/42"
- url, err := r.Get("article").URL("subdomain", "news",
- "category", "technology",
- "id", "42")
-
-Mux supports the addition of middlewares to a Router, which are executed in the order they are added if a match is found, including its subrouters. Middlewares are (typically) small pieces of code which take one request, do something with it, and pass it down to another middleware or the final handler. Some common use cases for middleware are request logging, header manipulation, or ResponseWriter hijacking.
-
- type MiddlewareFunc func(http.Handler) http.Handler
-
-Typically, the returned handler is a closure which does something with the http.ResponseWriter and http.Request passed to it, and then calls the handler passed as parameter to the MiddlewareFunc (closures can access variables from the context where they are created).
-
-A very basic middleware which logs the URI of the request being handled could be written as:
-
- func simpleMw(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- // Do stuff here
- log.Println(r.RequestURI)
- // Call the next handler, which can be another middleware in the chain, or the final handler.
- next.ServeHTTP(w, r)
- })
- }
-
-Middlewares can be added to a router using `Router.Use()`:
-
- r := mux.NewRouter()
- r.HandleFunc("/", handler)
- r.Use(simpleMw)
-
-A more complex authentication middleware, which maps session token to users, could be written as:
-
- // Define our struct
- type authenticationMiddleware struct {
- tokenUsers map[string]string
- }
-
- // Initialize it somewhere
- func (amw *authenticationMiddleware) Populate() {
- amw.tokenUsers["00000000"] = "user0"
- amw.tokenUsers["aaaaaaaa"] = "userA"
- amw.tokenUsers["05f717e5"] = "randomUser"
- amw.tokenUsers["deadbeef"] = "user0"
- }
-
- // Middleware function, which will be called for each request
- func (amw *authenticationMiddleware) Middleware(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, r *http.Request) {
- token := r.Header.Get("X-Session-Token")
-
- if user, found := amw.tokenUsers[token]; found {
- // We found the token in our map
- log.Printf("Authenticated user %s\n", user)
- next.ServeHTTP(w, r)
- } else {
- http.Error(w, "Forbidden", http.StatusForbidden)
- }
- })
- }
-
- r := mux.NewRouter()
- r.HandleFunc("/", handler)
-
- amw := authenticationMiddleware{}
- amw.Populate()
-
- r.Use(amw.Middleware)
-
-Note: The handler chain will be stopped if your middleware doesn't call `next.ServeHTTP()` with the corresponding parameters. This can be used to abort a request if the middleware writer wants to.
-
-*/
-package mux
diff --git a/vendor/github.com/gorilla/mux/middleware.go b/vendor/github.com/gorilla/mux/middleware.go
deleted file mode 100644
index ceb812c..0000000
--- a/vendor/github.com/gorilla/mux/middleware.go
+++ /dev/null
@@ -1,72 +0,0 @@
-package mux
-
-import (
- "net/http"
- "strings"
-)
-
-// MiddlewareFunc is a function which receives an http.Handler and returns another http.Handler.
-// Typically, the returned handler is a closure which does something with the http.ResponseWriter and http.Request passed
-// to it, and then calls the handler passed as parameter to the MiddlewareFunc.
-type MiddlewareFunc func(http.Handler) http.Handler
-
-// middleware interface is anything which implements a MiddlewareFunc named Middleware.
-type middleware interface {
- Middleware(handler http.Handler) http.Handler
-}
-
-// Middleware allows MiddlewareFunc to implement the middleware interface.
-func (mw MiddlewareFunc) Middleware(handler http.Handler) http.Handler {
- return mw(handler)
-}
-
-// Use appends a MiddlewareFunc to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router.
-func (r *Router) Use(mwf ...MiddlewareFunc) {
- for _, fn := range mwf {
- r.middlewares = append(r.middlewares, fn)
- }
-}
-
-// useInterface appends a middleware to the chain. Middleware can be used to intercept or otherwise modify requests and/or responses, and are executed in the order that they are applied to the Router.
-func (r *Router) useInterface(mw middleware) {
- r.middlewares = append(r.middlewares, mw)
-}
-
-// CORSMethodMiddleware sets the Access-Control-Allow-Methods response header
-// on a request, by matching routes based only on paths. It also handles
-// OPTIONS requests, by settings Access-Control-Allow-Methods, and then
-// returning without calling the next http handler.
-func CORSMethodMiddleware(r *Router) MiddlewareFunc {
- return func(next http.Handler) http.Handler {
- return http.HandlerFunc(func(w http.ResponseWriter, req *http.Request) {
- var allMethods []string
-
- err := r.Walk(func(route *Route, _ *Router, _ []*Route) error {
- for _, m := range route.matchers {
- if _, ok := m.(*routeRegexp); ok {
- if m.Match(req, &RouteMatch{}) {
- methods, err := route.GetMethods()
- if err != nil {
- return err
- }
-
- allMethods = append(allMethods, methods...)
- }
- break
- }
- }
- return nil
- })
-
- if err == nil {
- w.Header().Set("Access-Control-Allow-Methods", strings.Join(append(allMethods, "OPTIONS"), ","))
-
- if req.Method == "OPTIONS" {
- return
- }
- }
-
- next.ServeHTTP(w, req)
- })
- }
-}
diff --git a/vendor/github.com/gorilla/mux/mux.go b/vendor/github.com/gorilla/mux/mux.go
deleted file mode 100644
index 4bbafa5..0000000
--- a/vendor/github.com/gorilla/mux/mux.go
+++ /dev/null
@@ -1,588 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import (
- "errors"
- "fmt"
- "net/http"
- "path"
- "regexp"
-)
-
-var (
- // ErrMethodMismatch is returned when the method in the request does not match
- // the method defined against the route.
- ErrMethodMismatch = errors.New("method is not allowed")
- // ErrNotFound is returned when no route match is found.
- ErrNotFound = errors.New("no matching route was found")
-)
-
-// NewRouter returns a new router instance.
-func NewRouter() *Router {
- return &Router{namedRoutes: make(map[string]*Route), KeepContext: false}
-}
-
-// Router registers routes to be matched and dispatches a handler.
-//
-// It implements the http.Handler interface, so it can be registered to serve
-// requests:
-//
-// var router = mux.NewRouter()
-//
-// func main() {
-// http.Handle("/", router)
-// }
-//
-// Or, for Google App Engine, register it in a init() function:
-//
-// func init() {
-// http.Handle("/", router)
-// }
-//
-// This will send all incoming requests to the router.
-type Router struct {
- // Configurable Handler to be used when no route matches.
- NotFoundHandler http.Handler
-
- // Configurable Handler to be used when the request method does not match the route.
- MethodNotAllowedHandler http.Handler
-
- // Parent route, if this is a subrouter.
- parent parentRoute
- // Routes to be matched, in order.
- routes []*Route
- // Routes by name for URL building.
- namedRoutes map[string]*Route
- // See Router.StrictSlash(). This defines the flag for new routes.
- strictSlash bool
- // See Router.SkipClean(). This defines the flag for new routes.
- skipClean bool
- // If true, do not clear the request context after handling the request.
- // This has no effect when go1.7+ is used, since the context is stored
- // on the request itself.
- KeepContext bool
- // see Router.UseEncodedPath(). This defines a flag for all routes.
- useEncodedPath bool
- // Slice of middlewares to be called after a match is found
- middlewares []middleware
-}
-
-// Match attempts to match the given request against the router's registered routes.
-//
-// If the request matches a route of this router or one of its subrouters the Route,
-// Handler, and Vars fields of the the match argument are filled and this function
-// returns true.
-//
-// If the request does not match any of this router's or its subrouters' routes
-// then this function returns false. If available, a reason for the match failure
-// will be filled in the match argument's MatchErr field. If the match failure type
-// (eg: not found) has a registered handler, the handler is assigned to the Handler
-// field of the match argument.
-func (r *Router) Match(req *http.Request, match *RouteMatch) bool {
- for _, route := range r.routes {
- if route.Match(req, match) {
- // Build middleware chain if no error was found
- if match.MatchErr == nil {
- for i := len(r.middlewares) - 1; i >= 0; i-- {
- match.Handler = r.middlewares[i].Middleware(match.Handler)
- }
- }
- return true
- }
- }
-
- if match.MatchErr == ErrMethodMismatch {
- if r.MethodNotAllowedHandler != nil {
- match.Handler = r.MethodNotAllowedHandler
- return true
- }
-
- return false
- }
-
- // Closest match for a router (includes sub-routers)
- if r.NotFoundHandler != nil {
- match.Handler = r.NotFoundHandler
- match.MatchErr = ErrNotFound
- return true
- }
-
- match.MatchErr = ErrNotFound
- return false
-}
-
-// ServeHTTP dispatches the handler registered in the matched route.
-//
-// When there is a match, the route variables can be retrieved calling
-// mux.Vars(request).
-func (r *Router) ServeHTTP(w http.ResponseWriter, req *http.Request) {
- if !r.skipClean {
- path := req.URL.Path
- if r.useEncodedPath {
- path = req.URL.EscapedPath()
- }
- // Clean path to canonical form and redirect.
- if p := cleanPath(path); p != path {
-
- // Added 3 lines (Philip Schlump) - It was dropping the query string and #whatever from query.
- // This matches with fix in go 1.2 r.c. 4 for same problem. Go Issue:
- // http://code.google.com/p/go/issues/detail?id=5252
- url := *req.URL
- url.Path = p
- p = url.String()
-
- w.Header().Set("Location", p)
- w.WriteHeader(http.StatusMovedPermanently)
- return
- }
- }
- var match RouteMatch
- var handler http.Handler
- if r.Match(req, &match) {
- handler = match.Handler
- req = setVars(req, match.Vars)
- req = setCurrentRoute(req, match.Route)
- }
-
- if handler == nil && match.MatchErr == ErrMethodMismatch {
- handler = methodNotAllowedHandler()
- }
-
- if handler == nil {
- handler = http.NotFoundHandler()
- }
-
- if !r.KeepContext {
- defer contextClear(req)
- }
-
- handler.ServeHTTP(w, req)
-}
-
-// Get returns a route registered with the given name.
-func (r *Router) Get(name string) *Route {
- return r.getNamedRoutes()[name]
-}
-
-// GetRoute returns a route registered with the given name. This method
-// was renamed to Get() and remains here for backwards compatibility.
-func (r *Router) GetRoute(name string) *Route {
- return r.getNamedRoutes()[name]
-}
-
-// StrictSlash defines the trailing slash behavior for new routes. The initial
-// value is false.
-//
-// When true, if the route path is "/path/", accessing "/path" will perform a redirect
-// to the former and vice versa. In other words, your application will always
-// see the path as specified in the route.
-//
-// When false, if the route path is "/path", accessing "/path/" will not match
-// this route and vice versa.
-//
-// The re-direct is a HTTP 301 (Moved Permanently). Note that when this is set for
-// routes with a non-idempotent method (e.g. POST, PUT), the subsequent re-directed
-// request will be made as a GET by most clients. Use middleware or client settings
-// to modify this behaviour as needed.
-//
-// Special case: when a route sets a path prefix using the PathPrefix() method,
-// strict slash is ignored for that route because the redirect behavior can't
-// be determined from a prefix alone. However, any subrouters created from that
-// route inherit the original StrictSlash setting.
-func (r *Router) StrictSlash(value bool) *Router {
- r.strictSlash = value
- return r
-}
-
-// SkipClean defines the path cleaning behaviour for new routes. The initial
-// value is false. Users should be careful about which routes are not cleaned
-//
-// When true, if the route path is "/path//to", it will remain with the double
-// slash. This is helpful if you have a route like: /fetch/http://xkcd.com/534/
-//
-// When false, the path will be cleaned, so /fetch/http://xkcd.com/534/ will
-// become /fetch/http/xkcd.com/534
-func (r *Router) SkipClean(value bool) *Router {
- r.skipClean = value
- return r
-}
-
-// UseEncodedPath tells the router to match the encoded original path
-// to the routes.
-// For eg. "/path/foo%2Fbar/to" will match the path "/path/{var}/to".
-//
-// If not called, the router will match the unencoded path to the routes.
-// For eg. "/path/foo%2Fbar/to" will match the path "/path/foo/bar/to"
-func (r *Router) UseEncodedPath() *Router {
- r.useEncodedPath = true
- return r
-}
-
-// ----------------------------------------------------------------------------
-// parentRoute
-// ----------------------------------------------------------------------------
-
-func (r *Router) getBuildScheme() string {
- if r.parent != nil {
- return r.parent.getBuildScheme()
- }
- return ""
-}
-
-// getNamedRoutes returns the map where named routes are registered.
-func (r *Router) getNamedRoutes() map[string]*Route {
- if r.namedRoutes == nil {
- if r.parent != nil {
- r.namedRoutes = r.parent.getNamedRoutes()
- } else {
- r.namedRoutes = make(map[string]*Route)
- }
- }
- return r.namedRoutes
-}
-
-// getRegexpGroup returns regexp definitions from the parent route, if any.
-func (r *Router) getRegexpGroup() *routeRegexpGroup {
- if r.parent != nil {
- return r.parent.getRegexpGroup()
- }
- return nil
-}
-
-func (r *Router) buildVars(m map[string]string) map[string]string {
- if r.parent != nil {
- m = r.parent.buildVars(m)
- }
- return m
-}
-
-// ----------------------------------------------------------------------------
-// Route factories
-// ----------------------------------------------------------------------------
-
-// NewRoute registers an empty route.
-func (r *Router) NewRoute() *Route {
- route := &Route{parent: r, strictSlash: r.strictSlash, skipClean: r.skipClean, useEncodedPath: r.useEncodedPath}
- r.routes = append(r.routes, route)
- return route
-}
-
-// Handle registers a new route with a matcher for the URL path.
-// See Route.Path() and Route.Handler().
-func (r *Router) Handle(path string, handler http.Handler) *Route {
- return r.NewRoute().Path(path).Handler(handler)
-}
-
-// HandleFunc registers a new route with a matcher for the URL path.
-// See Route.Path() and Route.HandlerFunc().
-func (r *Router) HandleFunc(path string, f func(http.ResponseWriter,
- *http.Request)) *Route {
- return r.NewRoute().Path(path).HandlerFunc(f)
-}
-
-// Headers registers a new route with a matcher for request header values.
-// See Route.Headers().
-func (r *Router) Headers(pairs ...string) *Route {
- return r.NewRoute().Headers(pairs...)
-}
-
-// Host registers a new route with a matcher for the URL host.
-// See Route.Host().
-func (r *Router) Host(tpl string) *Route {
- return r.NewRoute().Host(tpl)
-}
-
-// MatcherFunc registers a new route with a custom matcher function.
-// See Route.MatcherFunc().
-func (r *Router) MatcherFunc(f MatcherFunc) *Route {
- return r.NewRoute().MatcherFunc(f)
-}
-
-// Methods registers a new route with a matcher for HTTP methods.
-// See Route.Methods().
-func (r *Router) Methods(methods ...string) *Route {
- return r.NewRoute().Methods(methods...)
-}
-
-// Path registers a new route with a matcher for the URL path.
-// See Route.Path().
-func (r *Router) Path(tpl string) *Route {
- return r.NewRoute().Path(tpl)
-}
-
-// PathPrefix registers a new route with a matcher for the URL path prefix.
-// See Route.PathPrefix().
-func (r *Router) PathPrefix(tpl string) *Route {
- return r.NewRoute().PathPrefix(tpl)
-}
-
-// Queries registers a new route with a matcher for URL query values.
-// See Route.Queries().
-func (r *Router) Queries(pairs ...string) *Route {
- return r.NewRoute().Queries(pairs...)
-}
-
-// Schemes registers a new route with a matcher for URL schemes.
-// See Route.Schemes().
-func (r *Router) Schemes(schemes ...string) *Route {
- return r.NewRoute().Schemes(schemes...)
-}
-
-// BuildVarsFunc registers a new route with a custom function for modifying
-// route variables before building a URL.
-func (r *Router) BuildVarsFunc(f BuildVarsFunc) *Route {
- return r.NewRoute().BuildVarsFunc(f)
-}
-
-// Walk walks the router and all its sub-routers, calling walkFn for each route
-// in the tree. The routes are walked in the order they were added. Sub-routers
-// are explored depth-first.
-func (r *Router) Walk(walkFn WalkFunc) error {
- return r.walk(walkFn, []*Route{})
-}
-
-// SkipRouter is used as a return value from WalkFuncs to indicate that the
-// router that walk is about to descend down to should be skipped.
-var SkipRouter = errors.New("skip this router")
-
-// WalkFunc is the type of the function called for each route visited by Walk.
-// At every invocation, it is given the current route, and the current router,
-// and a list of ancestor routes that lead to the current route.
-type WalkFunc func(route *Route, router *Router, ancestors []*Route) error
-
-func (r *Router) walk(walkFn WalkFunc, ancestors []*Route) error {
- for _, t := range r.routes {
- err := walkFn(t, r, ancestors)
- if err == SkipRouter {
- continue
- }
- if err != nil {
- return err
- }
- for _, sr := range t.matchers {
- if h, ok := sr.(*Router); ok {
- ancestors = append(ancestors, t)
- err := h.walk(walkFn, ancestors)
- if err != nil {
- return err
- }
- ancestors = ancestors[:len(ancestors)-1]
- }
- }
- if h, ok := t.handler.(*Router); ok {
- ancestors = append(ancestors, t)
- err := h.walk(walkFn, ancestors)
- if err != nil {
- return err
- }
- ancestors = ancestors[:len(ancestors)-1]
- }
- }
- return nil
-}
-
-// ----------------------------------------------------------------------------
-// Context
-// ----------------------------------------------------------------------------
-
-// RouteMatch stores information about a matched route.
-type RouteMatch struct {
- Route *Route
- Handler http.Handler
- Vars map[string]string
-
- // MatchErr is set to appropriate matching error
- // It is set to ErrMethodMismatch if there is a mismatch in
- // the request method and route method
- MatchErr error
-}
-
-type contextKey int
-
-const (
- varsKey contextKey = iota
- routeKey
-)
-
-// Vars returns the route variables for the current request, if any.
-func Vars(r *http.Request) map[string]string {
- if rv := contextGet(r, varsKey); rv != nil {
- return rv.(map[string]string)
- }
- return nil
-}
-
-// CurrentRoute returns the matched route for the current request, if any.
-// This only works when called inside the handler of the matched route
-// because the matched route is stored in the request context which is cleared
-// after the handler returns, unless the KeepContext option is set on the
-// Router.
-func CurrentRoute(r *http.Request) *Route {
- if rv := contextGet(r, routeKey); rv != nil {
- return rv.(*Route)
- }
- return nil
-}
-
-func setVars(r *http.Request, val interface{}) *http.Request {
- return contextSet(r, varsKey, val)
-}
-
-func setCurrentRoute(r *http.Request, val interface{}) *http.Request {
- return contextSet(r, routeKey, val)
-}
-
-// ----------------------------------------------------------------------------
-// Helpers
-// ----------------------------------------------------------------------------
-
-// cleanPath returns the canonical path for p, eliminating . and .. elements.
-// Borrowed from the net/http package.
-func cleanPath(p string) string {
- if p == "" {
- return "/"
- }
- if p[0] != '/' {
- p = "/" + p
- }
- np := path.Clean(p)
- // path.Clean removes trailing slash except for root;
- // put the trailing slash back if necessary.
- if p[len(p)-1] == '/' && np != "/" {
- np += "/"
- }
-
- return np
-}
-
-// uniqueVars returns an error if two slices contain duplicated strings.
-func uniqueVars(s1, s2 []string) error {
- for _, v1 := range s1 {
- for _, v2 := range s2 {
- if v1 == v2 {
- return fmt.Errorf("mux: duplicated route variable %q", v2)
- }
- }
- }
- return nil
-}
-
-// checkPairs returns the count of strings passed in, and an error if
-// the count is not an even number.
-func checkPairs(pairs ...string) (int, error) {
- length := len(pairs)
- if length%2 != 0 {
- return length, fmt.Errorf(
- "mux: number of parameters must be multiple of 2, got %v", pairs)
- }
- return length, nil
-}
-
-// mapFromPairsToString converts variadic string parameters to a
-// string to string map.
-func mapFromPairsToString(pairs ...string) (map[string]string, error) {
- length, err := checkPairs(pairs...)
- if err != nil {
- return nil, err
- }
- m := make(map[string]string, length/2)
- for i := 0; i < length; i += 2 {
- m[pairs[i]] = pairs[i+1]
- }
- return m, nil
-}
-
-// mapFromPairsToRegex converts variadic string parameters to a
-// string to regex map.
-func mapFromPairsToRegex(pairs ...string) (map[string]*regexp.Regexp, error) {
- length, err := checkPairs(pairs...)
- if err != nil {
- return nil, err
- }
- m := make(map[string]*regexp.Regexp, length/2)
- for i := 0; i < length; i += 2 {
- regex, err := regexp.Compile(pairs[i+1])
- if err != nil {
- return nil, err
- }
- m[pairs[i]] = regex
- }
- return m, nil
-}
-
-// matchInArray returns true if the given string value is in the array.
-func matchInArray(arr []string, value string) bool {
- for _, v := range arr {
- if v == value {
- return true
- }
- }
- return false
-}
-
-// matchMapWithString returns true if the given key/value pairs exist in a given map.
-func matchMapWithString(toCheck map[string]string, toMatch map[string][]string, canonicalKey bool) bool {
- for k, v := range toCheck {
- // Check if key exists.
- if canonicalKey {
- k = http.CanonicalHeaderKey(k)
- }
- if values := toMatch[k]; values == nil {
- return false
- } else if v != "" {
- // If value was defined as an empty string we only check that the
- // key exists. Otherwise we also check for equality.
- valueExists := false
- for _, value := range values {
- if v == value {
- valueExists = true
- break
- }
- }
- if !valueExists {
- return false
- }
- }
- }
- return true
-}
-
-// matchMapWithRegex returns true if the given key/value pairs exist in a given map compiled against
-// the given regex
-func matchMapWithRegex(toCheck map[string]*regexp.Regexp, toMatch map[string][]string, canonicalKey bool) bool {
- for k, v := range toCheck {
- // Check if key exists.
- if canonicalKey {
- k = http.CanonicalHeaderKey(k)
- }
- if values := toMatch[k]; values == nil {
- return false
- } else if v != nil {
- // If value was defined as an empty string we only check that the
- // key exists. Otherwise we also check for equality.
- valueExists := false
- for _, value := range values {
- if v.MatchString(value) {
- valueExists = true
- break
- }
- }
- if !valueExists {
- return false
- }
- }
- }
- return true
-}
-
-// methodNotAllowed replies to the request with an HTTP status code 405.
-func methodNotAllowed(w http.ResponseWriter, r *http.Request) {
- w.WriteHeader(http.StatusMethodNotAllowed)
-}
-
-// methodNotAllowedHandler returns a simple request handler
-// that replies to each request with a status code 405.
-func methodNotAllowedHandler() http.Handler { return http.HandlerFunc(methodNotAllowed) }
diff --git a/vendor/github.com/gorilla/mux/regexp.go b/vendor/github.com/gorilla/mux/regexp.go
deleted file mode 100644
index 2b57e56..0000000
--- a/vendor/github.com/gorilla/mux/regexp.go
+++ /dev/null
@@ -1,332 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import (
- "bytes"
- "fmt"
- "net/http"
- "net/url"
- "regexp"
- "strconv"
- "strings"
-)
-
-type routeRegexpOptions struct {
- strictSlash bool
- useEncodedPath bool
-}
-
-type regexpType int
-
-const (
- regexpTypePath regexpType = 0
- regexpTypeHost regexpType = 1
- regexpTypePrefix regexpType = 2
- regexpTypeQuery regexpType = 3
-)
-
-// newRouteRegexp parses a route template and returns a routeRegexp,
-// used to match a host, a path or a query string.
-//
-// It will extract named variables, assemble a regexp to be matched, create
-// a "reverse" template to build URLs and compile regexps to validate variable
-// values used in URL building.
-//
-// Previously we accepted only Python-like identifiers for variable
-// names ([a-zA-Z_][a-zA-Z0-9_]*), but currently the only restriction is that
-// name and pattern can't be empty, and names can't contain a colon.
-func newRouteRegexp(tpl string, typ regexpType, options routeRegexpOptions) (*routeRegexp, error) {
- // Check if it is well-formed.
- idxs, errBraces := braceIndices(tpl)
- if errBraces != nil {
- return nil, errBraces
- }
- // Backup the original.
- template := tpl
- // Now let's parse it.
- defaultPattern := "[^/]+"
- if typ == regexpTypeQuery {
- defaultPattern = ".*"
- } else if typ == regexpTypeHost {
- defaultPattern = "[^.]+"
- }
- // Only match strict slash if not matching
- if typ != regexpTypePath {
- options.strictSlash = false
- }
- // Set a flag for strictSlash.
- endSlash := false
- if options.strictSlash && strings.HasSuffix(tpl, "/") {
- tpl = tpl[:len(tpl)-1]
- endSlash = true
- }
- varsN := make([]string, len(idxs)/2)
- varsR := make([]*regexp.Regexp, len(idxs)/2)
- pattern := bytes.NewBufferString("")
- pattern.WriteByte('^')
- reverse := bytes.NewBufferString("")
- var end int
- var err error
- for i := 0; i < len(idxs); i += 2 {
- // Set all values we are interested in.
- raw := tpl[end:idxs[i]]
- end = idxs[i+1]
- parts := strings.SplitN(tpl[idxs[i]+1:end-1], ":", 2)
- name := parts[0]
- patt := defaultPattern
- if len(parts) == 2 {
- patt = parts[1]
- }
- // Name or pattern can't be empty.
- if name == "" || patt == "" {
- return nil, fmt.Errorf("mux: missing name or pattern in %q",
- tpl[idxs[i]:end])
- }
- // Build the regexp pattern.
- fmt.Fprintf(pattern, "%s(?P<%s>%s)", regexp.QuoteMeta(raw), varGroupName(i/2), patt)
-
- // Build the reverse template.
- fmt.Fprintf(reverse, "%s%%s", raw)
-
- // Append variable name and compiled pattern.
- varsN[i/2] = name
- varsR[i/2], err = regexp.Compile(fmt.Sprintf("^%s$", patt))
- if err != nil {
- return nil, err
- }
- }
- // Add the remaining.
- raw := tpl[end:]
- pattern.WriteString(regexp.QuoteMeta(raw))
- if options.strictSlash {
- pattern.WriteString("[/]?")
- }
- if typ == regexpTypeQuery {
- // Add the default pattern if the query value is empty
- if queryVal := strings.SplitN(template, "=", 2)[1]; queryVal == "" {
- pattern.WriteString(defaultPattern)
- }
- }
- if typ != regexpTypePrefix {
- pattern.WriteByte('$')
- }
- reverse.WriteString(raw)
- if endSlash {
- reverse.WriteByte('/')
- }
- // Compile full regexp.
- reg, errCompile := regexp.Compile(pattern.String())
- if errCompile != nil {
- return nil, errCompile
- }
-
- // Check for capturing groups which used to work in older versions
- if reg.NumSubexp() != len(idxs)/2 {
- panic(fmt.Sprintf("route %s contains capture groups in its regexp. ", template) +
- "Only non-capturing groups are accepted: e.g. (?:pattern) instead of (pattern)")
- }
-
- // Done!
- return &routeRegexp{
- template: template,
- regexpType: typ,
- options: options,
- regexp: reg,
- reverse: reverse.String(),
- varsN: varsN,
- varsR: varsR,
- }, nil
-}
-
-// routeRegexp stores a regexp to match a host or path and information to
-// collect and validate route variables.
-type routeRegexp struct {
- // The unmodified template.
- template string
- // The type of match
- regexpType regexpType
- // Options for matching
- options routeRegexpOptions
- // Expanded regexp.
- regexp *regexp.Regexp
- // Reverse template.
- reverse string
- // Variable names.
- varsN []string
- // Variable regexps (validators).
- varsR []*regexp.Regexp
-}
-
-// Match matches the regexp against the URL host or path.
-func (r *routeRegexp) Match(req *http.Request, match *RouteMatch) bool {
- if r.regexpType != regexpTypeHost {
- if r.regexpType == regexpTypeQuery {
- return r.matchQueryString(req)
- }
- path := req.URL.Path
- if r.options.useEncodedPath {
- path = req.URL.EscapedPath()
- }
- return r.regexp.MatchString(path)
- }
-
- return r.regexp.MatchString(getHost(req))
-}
-
-// url builds a URL part using the given values.
-func (r *routeRegexp) url(values map[string]string) (string, error) {
- urlValues := make([]interface{}, len(r.varsN))
- for k, v := range r.varsN {
- value, ok := values[v]
- if !ok {
- return "", fmt.Errorf("mux: missing route variable %q", v)
- }
- if r.regexpType == regexpTypeQuery {
- value = url.QueryEscape(value)
- }
- urlValues[k] = value
- }
- rv := fmt.Sprintf(r.reverse, urlValues...)
- if !r.regexp.MatchString(rv) {
- // The URL is checked against the full regexp, instead of checking
- // individual variables. This is faster but to provide a good error
- // message, we check individual regexps if the URL doesn't match.
- for k, v := range r.varsN {
- if !r.varsR[k].MatchString(values[v]) {
- return "", fmt.Errorf(
- "mux: variable %q doesn't match, expected %q", values[v],
- r.varsR[k].String())
- }
- }
- }
- return rv, nil
-}
-
-// getURLQuery returns a single query parameter from a request URL.
-// For a URL with foo=bar&baz=ding, we return only the relevant key
-// value pair for the routeRegexp.
-func (r *routeRegexp) getURLQuery(req *http.Request) string {
- if r.regexpType != regexpTypeQuery {
- return ""
- }
- templateKey := strings.SplitN(r.template, "=", 2)[0]
- for key, vals := range req.URL.Query() {
- if key == templateKey && len(vals) > 0 {
- return key + "=" + vals[0]
- }
- }
- return ""
-}
-
-func (r *routeRegexp) matchQueryString(req *http.Request) bool {
- return r.regexp.MatchString(r.getURLQuery(req))
-}
-
-// braceIndices returns the first level curly brace indices from a string.
-// It returns an error in case of unbalanced braces.
-func braceIndices(s string) ([]int, error) {
- var level, idx int
- var idxs []int
- for i := 0; i < len(s); i++ {
- switch s[i] {
- case '{':
- if level++; level == 1 {
- idx = i
- }
- case '}':
- if level--; level == 0 {
- idxs = append(idxs, idx, i+1)
- } else if level < 0 {
- return nil, fmt.Errorf("mux: unbalanced braces in %q", s)
- }
- }
- }
- if level != 0 {
- return nil, fmt.Errorf("mux: unbalanced braces in %q", s)
- }
- return idxs, nil
-}
-
-// varGroupName builds a capturing group name for the indexed variable.
-func varGroupName(idx int) string {
- return "v" + strconv.Itoa(idx)
-}
-
-// ----------------------------------------------------------------------------
-// routeRegexpGroup
-// ----------------------------------------------------------------------------
-
-// routeRegexpGroup groups the route matchers that carry variables.
-type routeRegexpGroup struct {
- host *routeRegexp
- path *routeRegexp
- queries []*routeRegexp
-}
-
-// setMatch extracts the variables from the URL once a route matches.
-func (v *routeRegexpGroup) setMatch(req *http.Request, m *RouteMatch, r *Route) {
- // Store host variables.
- if v.host != nil {
- host := getHost(req)
- matches := v.host.regexp.FindStringSubmatchIndex(host)
- if len(matches) > 0 {
- extractVars(host, matches, v.host.varsN, m.Vars)
- }
- }
- path := req.URL.Path
- if r.useEncodedPath {
- path = req.URL.EscapedPath()
- }
- // Store path variables.
- if v.path != nil {
- matches := v.path.regexp.FindStringSubmatchIndex(path)
- if len(matches) > 0 {
- extractVars(path, matches, v.path.varsN, m.Vars)
- // Check if we should redirect.
- if v.path.options.strictSlash {
- p1 := strings.HasSuffix(path, "/")
- p2 := strings.HasSuffix(v.path.template, "/")
- if p1 != p2 {
- u, _ := url.Parse(req.URL.String())
- if p1 {
- u.Path = u.Path[:len(u.Path)-1]
- } else {
- u.Path += "/"
- }
- m.Handler = http.RedirectHandler(u.String(), 301)
- }
- }
- }
- }
- // Store query string variables.
- for _, q := range v.queries {
- queryURL := q.getURLQuery(req)
- matches := q.regexp.FindStringSubmatchIndex(queryURL)
- if len(matches) > 0 {
- extractVars(queryURL, matches, q.varsN, m.Vars)
- }
- }
-}
-
-// getHost tries its best to return the request host.
-func getHost(r *http.Request) string {
- if r.URL.IsAbs() {
- return r.URL.Host
- }
- host := r.Host
- // Slice off any port information.
- if i := strings.Index(host, ":"); i != -1 {
- host = host[:i]
- }
- return host
-
-}
-
-func extractVars(input string, matches []int, names []string, output map[string]string) {
- for i, name := range names {
- output[name] = input[matches[2*i+2]:matches[2*i+3]]
- }
-}
diff --git a/vendor/github.com/gorilla/mux/route.go b/vendor/github.com/gorilla/mux/route.go
deleted file mode 100644
index a591d73..0000000
--- a/vendor/github.com/gorilla/mux/route.go
+++ /dev/null
@@ -1,763 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import (
- "errors"
- "fmt"
- "net/http"
- "net/url"
- "regexp"
- "strings"
-)
-
-// Route stores information to match a request and build URLs.
-type Route struct {
- // Parent where the route was registered (a Router).
- parent parentRoute
- // Request handler for the route.
- handler http.Handler
- // List of matchers.
- matchers []matcher
- // Manager for the variables from host and path.
- regexp *routeRegexpGroup
- // If true, when the path pattern is "/path/", accessing "/path" will
- // redirect to the former and vice versa.
- strictSlash bool
- // If true, when the path pattern is "/path//to", accessing "/path//to"
- // will not redirect
- skipClean bool
- // If true, "/path/foo%2Fbar/to" will match the path "/path/{var}/to"
- useEncodedPath bool
- // The scheme used when building URLs.
- buildScheme string
- // If true, this route never matches: it is only used to build URLs.
- buildOnly bool
- // The name used to build URLs.
- name string
- // Error resulted from building a route.
- err error
-
- buildVarsFunc BuildVarsFunc
-}
-
-// SkipClean reports whether path cleaning is enabled for this route via
-// Router.SkipClean.
-func (r *Route) SkipClean() bool {
- return r.skipClean
-}
-
-// Match matches the route against the request.
-func (r *Route) Match(req *http.Request, match *RouteMatch) bool {
- if r.buildOnly || r.err != nil {
- return false
- }
-
- var matchErr error
-
- // Match everything.
- for _, m := range r.matchers {
- if matched := m.Match(req, match); !matched {
- if _, ok := m.(methodMatcher); ok {
- matchErr = ErrMethodMismatch
- continue
- }
- matchErr = nil
- return false
- }
- }
-
- if matchErr != nil {
- match.MatchErr = matchErr
- return false
- }
-
- if match.MatchErr == ErrMethodMismatch {
- // We found a route which matches request method, clear MatchErr
- match.MatchErr = nil
- // Then override the mis-matched handler
- match.Handler = r.handler
- }
-
- // Yay, we have a match. Let's collect some info about it.
- if match.Route == nil {
- match.Route = r
- }
- if match.Handler == nil {
- match.Handler = r.handler
- }
- if match.Vars == nil {
- match.Vars = make(map[string]string)
- }
-
- // Set variables.
- if r.regexp != nil {
- r.regexp.setMatch(req, match, r)
- }
- return true
-}
-
-// ----------------------------------------------------------------------------
-// Route attributes
-// ----------------------------------------------------------------------------
-
-// GetError returns an error resulted from building the route, if any.
-func (r *Route) GetError() error {
- return r.err
-}
-
-// BuildOnly sets the route to never match: it is only used to build URLs.
-func (r *Route) BuildOnly() *Route {
- r.buildOnly = true
- return r
-}
-
-// Handler --------------------------------------------------------------------
-
-// Handler sets a handler for the route.
-func (r *Route) Handler(handler http.Handler) *Route {
- if r.err == nil {
- r.handler = handler
- }
- return r
-}
-
-// HandlerFunc sets a handler function for the route.
-func (r *Route) HandlerFunc(f func(http.ResponseWriter, *http.Request)) *Route {
- return r.Handler(http.HandlerFunc(f))
-}
-
-// GetHandler returns the handler for the route, if any.
-func (r *Route) GetHandler() http.Handler {
- return r.handler
-}
-
-// Name -----------------------------------------------------------------------
-
-// Name sets the name for the route, used to build URLs.
-// If the name was registered already it will be overwritten.
-func (r *Route) Name(name string) *Route {
- if r.name != "" {
- r.err = fmt.Errorf("mux: route already has name %q, can't set %q",
- r.name, name)
- }
- if r.err == nil {
- r.name = name
- r.getNamedRoutes()[name] = r
- }
- return r
-}
-
-// GetName returns the name for the route, if any.
-func (r *Route) GetName() string {
- return r.name
-}
-
-// ----------------------------------------------------------------------------
-// Matchers
-// ----------------------------------------------------------------------------
-
-// matcher types try to match a request.
-type matcher interface {
- Match(*http.Request, *RouteMatch) bool
-}
-
-// addMatcher adds a matcher to the route.
-func (r *Route) addMatcher(m matcher) *Route {
- if r.err == nil {
- r.matchers = append(r.matchers, m)
- }
- return r
-}
-
-// addRegexpMatcher adds a host or path matcher and builder to a route.
-func (r *Route) addRegexpMatcher(tpl string, typ regexpType) error {
- if r.err != nil {
- return r.err
- }
- r.regexp = r.getRegexpGroup()
- if typ == regexpTypePath || typ == regexpTypePrefix {
- if len(tpl) > 0 && tpl[0] != '/' {
- return fmt.Errorf("mux: path must start with a slash, got %q", tpl)
- }
- if r.regexp.path != nil {
- tpl = strings.TrimRight(r.regexp.path.template, "/") + tpl
- }
- }
- rr, err := newRouteRegexp(tpl, typ, routeRegexpOptions{
- strictSlash: r.strictSlash,
- useEncodedPath: r.useEncodedPath,
- })
- if err != nil {
- return err
- }
- for _, q := range r.regexp.queries {
- if err = uniqueVars(rr.varsN, q.varsN); err != nil {
- return err
- }
- }
- if typ == regexpTypeHost {
- if r.regexp.path != nil {
- if err = uniqueVars(rr.varsN, r.regexp.path.varsN); err != nil {
- return err
- }
- }
- r.regexp.host = rr
- } else {
- if r.regexp.host != nil {
- if err = uniqueVars(rr.varsN, r.regexp.host.varsN); err != nil {
- return err
- }
- }
- if typ == regexpTypeQuery {
- r.regexp.queries = append(r.regexp.queries, rr)
- } else {
- r.regexp.path = rr
- }
- }
- r.addMatcher(rr)
- return nil
-}
-
-// Headers --------------------------------------------------------------------
-
-// headerMatcher matches the request against header values.
-type headerMatcher map[string]string
-
-func (m headerMatcher) Match(r *http.Request, match *RouteMatch) bool {
- return matchMapWithString(m, r.Header, true)
-}
-
-// Headers adds a matcher for request header values.
-// It accepts a sequence of key/value pairs to be matched. For example:
-//
-// r := mux.NewRouter()
-// r.Headers("Content-Type", "application/json",
-// "X-Requested-With", "XMLHttpRequest")
-//
-// The above route will only match if both request header values match.
-// If the value is an empty string, it will match any value if the key is set.
-func (r *Route) Headers(pairs ...string) *Route {
- if r.err == nil {
- var headers map[string]string
- headers, r.err = mapFromPairsToString(pairs...)
- return r.addMatcher(headerMatcher(headers))
- }
- return r
-}
-
-// headerRegexMatcher matches the request against the route given a regex for the header
-type headerRegexMatcher map[string]*regexp.Regexp
-
-func (m headerRegexMatcher) Match(r *http.Request, match *RouteMatch) bool {
- return matchMapWithRegex(m, r.Header, true)
-}
-
-// HeadersRegexp accepts a sequence of key/value pairs, where the value has regex
-// support. For example:
-//
-// r := mux.NewRouter()
-// r.HeadersRegexp("Content-Type", "application/(text|json)",
-// "X-Requested-With", "XMLHttpRequest")
-//
-// The above route will only match if both the request header matches both regular expressions.
-// If the value is an empty string, it will match any value if the key is set.
-// Use the start and end of string anchors (^ and $) to match an exact value.
-func (r *Route) HeadersRegexp(pairs ...string) *Route {
- if r.err == nil {
- var headers map[string]*regexp.Regexp
- headers, r.err = mapFromPairsToRegex(pairs...)
- return r.addMatcher(headerRegexMatcher(headers))
- }
- return r
-}
-
-// Host -----------------------------------------------------------------------
-
-// Host adds a matcher for the URL host.
-// It accepts a template with zero or more URL variables enclosed by {}.
-// Variables can define an optional regexp pattern to be matched:
-//
-// - {name} matches anything until the next dot.
-//
-// - {name:pattern} matches the given regexp pattern.
-//
-// For example:
-//
-// r := mux.NewRouter()
-// r.Host("www.example.com")
-// r.Host("{subdomain}.domain.com")
-// r.Host("{subdomain:[a-z]+}.domain.com")
-//
-// Variable names must be unique in a given route. They can be retrieved
-// calling mux.Vars(request).
-func (r *Route) Host(tpl string) *Route {
- r.err = r.addRegexpMatcher(tpl, regexpTypeHost)
- return r
-}
-
-// MatcherFunc ----------------------------------------------------------------
-
-// MatcherFunc is the function signature used by custom matchers.
-type MatcherFunc func(*http.Request, *RouteMatch) bool
-
-// Match returns the match for a given request.
-func (m MatcherFunc) Match(r *http.Request, match *RouteMatch) bool {
- return m(r, match)
-}
-
-// MatcherFunc adds a custom function to be used as request matcher.
-func (r *Route) MatcherFunc(f MatcherFunc) *Route {
- return r.addMatcher(f)
-}
-
-// Methods --------------------------------------------------------------------
-
-// methodMatcher matches the request against HTTP methods.
-type methodMatcher []string
-
-func (m methodMatcher) Match(r *http.Request, match *RouteMatch) bool {
- return matchInArray(m, r.Method)
-}
-
-// Methods adds a matcher for HTTP methods.
-// It accepts a sequence of one or more methods to be matched, e.g.:
-// "GET", "POST", "PUT".
-func (r *Route) Methods(methods ...string) *Route {
- for k, v := range methods {
- methods[k] = strings.ToUpper(v)
- }
- return r.addMatcher(methodMatcher(methods))
-}
-
-// Path -----------------------------------------------------------------------
-
-// Path adds a matcher for the URL path.
-// It accepts a template with zero or more URL variables enclosed by {}. The
-// template must start with a "/".
-// Variables can define an optional regexp pattern to be matched:
-//
-// - {name} matches anything until the next slash.
-//
-// - {name:pattern} matches the given regexp pattern.
-//
-// For example:
-//
-// r := mux.NewRouter()
-// r.Path("/products/").Handler(ProductsHandler)
-// r.Path("/products/{key}").Handler(ProductsHandler)
-// r.Path("/articles/{category}/{id:[0-9]+}").
-// Handler(ArticleHandler)
-//
-// Variable names must be unique in a given route. They can be retrieved
-// calling mux.Vars(request).
-func (r *Route) Path(tpl string) *Route {
- r.err = r.addRegexpMatcher(tpl, regexpTypePath)
- return r
-}
-
-// PathPrefix -----------------------------------------------------------------
-
-// PathPrefix adds a matcher for the URL path prefix. This matches if the given
-// template is a prefix of the full URL path. See Route.Path() for details on
-// the tpl argument.
-//
-// Note that it does not treat slashes specially ("/foobar/" will be matched by
-// the prefix "/foo") so you may want to use a trailing slash here.
-//
-// Also note that the setting of Router.StrictSlash() has no effect on routes
-// with a PathPrefix matcher.
-func (r *Route) PathPrefix(tpl string) *Route {
- r.err = r.addRegexpMatcher(tpl, regexpTypePrefix)
- return r
-}
-
-// Query ----------------------------------------------------------------------
-
-// Queries adds a matcher for URL query values.
-// It accepts a sequence of key/value pairs. Values may define variables.
-// For example:
-//
-// r := mux.NewRouter()
-// r.Queries("foo", "bar", "id", "{id:[0-9]+}")
-//
-// The above route will only match if the URL contains the defined queries
-// values, e.g.: ?foo=bar&id=42.
-//
-// It the value is an empty string, it will match any value if the key is set.
-//
-// Variables can define an optional regexp pattern to be matched:
-//
-// - {name} matches anything until the next slash.
-//
-// - {name:pattern} matches the given regexp pattern.
-func (r *Route) Queries(pairs ...string) *Route {
- length := len(pairs)
- if length%2 != 0 {
- r.err = fmt.Errorf(
- "mux: number of parameters must be multiple of 2, got %v", pairs)
- return nil
- }
- for i := 0; i < length; i += 2 {
- if r.err = r.addRegexpMatcher(pairs[i]+"="+pairs[i+1], regexpTypeQuery); r.err != nil {
- return r
- }
- }
-
- return r
-}
-
-// Schemes --------------------------------------------------------------------
-
-// schemeMatcher matches the request against URL schemes.
-type schemeMatcher []string
-
-func (m schemeMatcher) Match(r *http.Request, match *RouteMatch) bool {
- return matchInArray(m, r.URL.Scheme)
-}
-
-// Schemes adds a matcher for URL schemes.
-// It accepts a sequence of schemes to be matched, e.g.: "http", "https".
-func (r *Route) Schemes(schemes ...string) *Route {
- for k, v := range schemes {
- schemes[k] = strings.ToLower(v)
- }
- if r.buildScheme == "" && len(schemes) > 0 {
- r.buildScheme = schemes[0]
- }
- return r.addMatcher(schemeMatcher(schemes))
-}
-
-// BuildVarsFunc --------------------------------------------------------------
-
-// BuildVarsFunc is the function signature used by custom build variable
-// functions (which can modify route variables before a route's URL is built).
-type BuildVarsFunc func(map[string]string) map[string]string
-
-// BuildVarsFunc adds a custom function to be used to modify build variables
-// before a route's URL is built.
-func (r *Route) BuildVarsFunc(f BuildVarsFunc) *Route {
- r.buildVarsFunc = f
- return r
-}
-
-// Subrouter ------------------------------------------------------------------
-
-// Subrouter creates a subrouter for the route.
-//
-// It will test the inner routes only if the parent route matched. For example:
-//
-// r := mux.NewRouter()
-// s := r.Host("www.example.com").Subrouter()
-// s.HandleFunc("/products/", ProductsHandler)
-// s.HandleFunc("/products/{key}", ProductHandler)
-// s.HandleFunc("/articles/{category}/{id:[0-9]+}"), ArticleHandler)
-//
-// Here, the routes registered in the subrouter won't be tested if the host
-// doesn't match.
-func (r *Route) Subrouter() *Router {
- router := &Router{parent: r, strictSlash: r.strictSlash}
- r.addMatcher(router)
- return router
-}
-
-// ----------------------------------------------------------------------------
-// URL building
-// ----------------------------------------------------------------------------
-
-// URL builds a URL for the route.
-//
-// It accepts a sequence of key/value pairs for the route variables. For
-// example, given this route:
-//
-// r := mux.NewRouter()
-// r.HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler).
-// Name("article")
-//
-// ...a URL for it can be built using:
-//
-// url, err := r.Get("article").URL("category", "technology", "id", "42")
-//
-// ...which will return an url.URL with the following path:
-//
-// "/articles/technology/42"
-//
-// This also works for host variables:
-//
-// r := mux.NewRouter()
-// r.Host("{subdomain}.domain.com").
-// HandleFunc("/articles/{category}/{id:[0-9]+}", ArticleHandler).
-// Name("article")
-//
-// // url.String() will be "http://news.domain.com/articles/technology/42"
-// url, err := r.Get("article").URL("subdomain", "news",
-// "category", "technology",
-// "id", "42")
-//
-// All variables defined in the route are required, and their values must
-// conform to the corresponding patterns.
-func (r *Route) URL(pairs ...string) (*url.URL, error) {
- if r.err != nil {
- return nil, r.err
- }
- if r.regexp == nil {
- return nil, errors.New("mux: route doesn't have a host or path")
- }
- values, err := r.prepareVars(pairs...)
- if err != nil {
- return nil, err
- }
- var scheme, host, path string
- queries := make([]string, 0, len(r.regexp.queries))
- if r.regexp.host != nil {
- if host, err = r.regexp.host.url(values); err != nil {
- return nil, err
- }
- scheme = "http"
- if s := r.getBuildScheme(); s != "" {
- scheme = s
- }
- }
- if r.regexp.path != nil {
- if path, err = r.regexp.path.url(values); err != nil {
- return nil, err
- }
- }
- for _, q := range r.regexp.queries {
- var query string
- if query, err = q.url(values); err != nil {
- return nil, err
- }
- queries = append(queries, query)
- }
- return &url.URL{
- Scheme: scheme,
- Host: host,
- Path: path,
- RawQuery: strings.Join(queries, "&"),
- }, nil
-}
-
-// URLHost builds the host part of the URL for a route. See Route.URL().
-//
-// The route must have a host defined.
-func (r *Route) URLHost(pairs ...string) (*url.URL, error) {
- if r.err != nil {
- return nil, r.err
- }
- if r.regexp == nil || r.regexp.host == nil {
- return nil, errors.New("mux: route doesn't have a host")
- }
- values, err := r.prepareVars(pairs...)
- if err != nil {
- return nil, err
- }
- host, err := r.regexp.host.url(values)
- if err != nil {
- return nil, err
- }
- u := &url.URL{
- Scheme: "http",
- Host: host,
- }
- if s := r.getBuildScheme(); s != "" {
- u.Scheme = s
- }
- return u, nil
-}
-
-// URLPath builds the path part of the URL for a route. See Route.URL().
-//
-// The route must have a path defined.
-func (r *Route) URLPath(pairs ...string) (*url.URL, error) {
- if r.err != nil {
- return nil, r.err
- }
- if r.regexp == nil || r.regexp.path == nil {
- return nil, errors.New("mux: route doesn't have a path")
- }
- values, err := r.prepareVars(pairs...)
- if err != nil {
- return nil, err
- }
- path, err := r.regexp.path.url(values)
- if err != nil {
- return nil, err
- }
- return &url.URL{
- Path: path,
- }, nil
-}
-
-// GetPathTemplate returns the template used to build the
-// route match.
-// This is useful for building simple REST API documentation and for instrumentation
-// against third-party services.
-// An error will be returned if the route does not define a path.
-func (r *Route) GetPathTemplate() (string, error) {
- if r.err != nil {
- return "", r.err
- }
- if r.regexp == nil || r.regexp.path == nil {
- return "", errors.New("mux: route doesn't have a path")
- }
- return r.regexp.path.template, nil
-}
-
-// GetPathRegexp returns the expanded regular expression used to match route path.
-// This is useful for building simple REST API documentation and for instrumentation
-// against third-party services.
-// An error will be returned if the route does not define a path.
-func (r *Route) GetPathRegexp() (string, error) {
- if r.err != nil {
- return "", r.err
- }
- if r.regexp == nil || r.regexp.path == nil {
- return "", errors.New("mux: route does not have a path")
- }
- return r.regexp.path.regexp.String(), nil
-}
-
-// GetQueriesRegexp returns the expanded regular expressions used to match the
-// route queries.
-// This is useful for building simple REST API documentation and for instrumentation
-// against third-party services.
-// An error will be returned if the route does not have queries.
-func (r *Route) GetQueriesRegexp() ([]string, error) {
- if r.err != nil {
- return nil, r.err
- }
- if r.regexp == nil || r.regexp.queries == nil {
- return nil, errors.New("mux: route doesn't have queries")
- }
- var queries []string
- for _, query := range r.regexp.queries {
- queries = append(queries, query.regexp.String())
- }
- return queries, nil
-}
-
-// GetQueriesTemplates returns the templates used to build the
-// query matching.
-// This is useful for building simple REST API documentation and for instrumentation
-// against third-party services.
-// An error will be returned if the route does not define queries.
-func (r *Route) GetQueriesTemplates() ([]string, error) {
- if r.err != nil {
- return nil, r.err
- }
- if r.regexp == nil || r.regexp.queries == nil {
- return nil, errors.New("mux: route doesn't have queries")
- }
- var queries []string
- for _, query := range r.regexp.queries {
- queries = append(queries, query.template)
- }
- return queries, nil
-}
-
-// GetMethods returns the methods the route matches against
-// This is useful for building simple REST API documentation and for instrumentation
-// against third-party services.
-// An error will be returned if route does not have methods.
-func (r *Route) GetMethods() ([]string, error) {
- if r.err != nil {
- return nil, r.err
- }
- for _, m := range r.matchers {
- if methods, ok := m.(methodMatcher); ok {
- return []string(methods), nil
- }
- }
- return nil, errors.New("mux: route doesn't have methods")
-}
-
-// GetHostTemplate returns the template used to build the
-// route match.
-// This is useful for building simple REST API documentation and for instrumentation
-// against third-party services.
-// An error will be returned if the route does not define a host.
-func (r *Route) GetHostTemplate() (string, error) {
- if r.err != nil {
- return "", r.err
- }
- if r.regexp == nil || r.regexp.host == nil {
- return "", errors.New("mux: route doesn't have a host")
- }
- return r.regexp.host.template, nil
-}
-
-// prepareVars converts the route variable pairs into a map. If the route has a
-// BuildVarsFunc, it is invoked.
-func (r *Route) prepareVars(pairs ...string) (map[string]string, error) {
- m, err := mapFromPairsToString(pairs...)
- if err != nil {
- return nil, err
- }
- return r.buildVars(m), nil
-}
-
-func (r *Route) buildVars(m map[string]string) map[string]string {
- if r.parent != nil {
- m = r.parent.buildVars(m)
- }
- if r.buildVarsFunc != nil {
- m = r.buildVarsFunc(m)
- }
- return m
-}
-
-// ----------------------------------------------------------------------------
-// parentRoute
-// ----------------------------------------------------------------------------
-
-// parentRoute allows routes to know about parent host and path definitions.
-type parentRoute interface {
- getBuildScheme() string
- getNamedRoutes() map[string]*Route
- getRegexpGroup() *routeRegexpGroup
- buildVars(map[string]string) map[string]string
-}
-
-func (r *Route) getBuildScheme() string {
- if r.buildScheme != "" {
- return r.buildScheme
- }
- if r.parent != nil {
- return r.parent.getBuildScheme()
- }
- return ""
-}
-
-// getNamedRoutes returns the map where named routes are registered.
-func (r *Route) getNamedRoutes() map[string]*Route {
- if r.parent == nil {
- // During tests router is not always set.
- r.parent = NewRouter()
- }
- return r.parent.getNamedRoutes()
-}
-
-// getRegexpGroup returns regexp definitions from this route.
-func (r *Route) getRegexpGroup() *routeRegexpGroup {
- if r.regexp == nil {
- if r.parent == nil {
- // During tests router is not always set.
- r.parent = NewRouter()
- }
- regexp := r.parent.getRegexpGroup()
- if regexp == nil {
- r.regexp = new(routeRegexpGroup)
- } else {
- // Copy.
- r.regexp = &routeRegexpGroup{
- host: regexp.host,
- path: regexp.path,
- queries: regexp.queries,
- }
- }
- }
- return r.regexp
-}
diff --git a/vendor/github.com/gorilla/mux/test_helpers.go b/vendor/github.com/gorilla/mux/test_helpers.go
deleted file mode 100644
index 32ecffd..0000000
--- a/vendor/github.com/gorilla/mux/test_helpers.go
+++ /dev/null
@@ -1,19 +0,0 @@
-// Copyright 2012 The Gorilla Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package mux
-
-import "net/http"
-
-// SetURLVars sets the URL variables for the given request, to be accessed via
-// mux.Vars for testing route behaviour. Arguments are not modified, a shallow
-// copy is returned.
-//
-// This API should only be used for testing purposes; it provides a way to
-// inject variables into the request context. Alternatively, URL variables
-// can be set by making a route that captures the required variables,
-// starting a server and sending the request to that server.
-func SetURLVars(r *http.Request, val map[string]string) *http.Request {
- return setVars(r, val)
-}
diff --git a/vendor/github.com/inconshreveable/mousetrap/LICENSE b/vendor/github.com/inconshreveable/mousetrap/LICENSE
deleted file mode 100644
index 5f0d1fb..0000000
--- a/vendor/github.com/inconshreveable/mousetrap/LICENSE
+++ /dev/null
@@ -1,13 +0,0 @@
-Copyright 2014 Alan Shreve
-
-Licensed under the Apache License, Version 2.0 (the "License");
-you may not use this file except in compliance with the License.
-You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
-Unless required by applicable law or agreed to in writing, software
-distributed under the License is distributed on an "AS IS" BASIS,
-WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-See the License for the specific language governing permissions and
-limitations under the License.
diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_others.go b/vendor/github.com/inconshreveable/mousetrap/trap_others.go
deleted file mode 100644
index 9d2d8a4..0000000
--- a/vendor/github.com/inconshreveable/mousetrap/trap_others.go
+++ /dev/null
@@ -1,15 +0,0 @@
-// +build !windows
-
-package mousetrap
-
-// StartedByExplorer returns true if the program was invoked by the user
-// double-clicking on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-//
-// On non-Windows platforms, it always returns false.
-func StartedByExplorer() bool {
- return false
-}
diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_windows.go b/vendor/github.com/inconshreveable/mousetrap/trap_windows.go
deleted file mode 100644
index 336142a..0000000
--- a/vendor/github.com/inconshreveable/mousetrap/trap_windows.go
+++ /dev/null
@@ -1,98 +0,0 @@
-// +build windows
-// +build !go1.4
-
-package mousetrap
-
-import (
- "fmt"
- "os"
- "syscall"
- "unsafe"
-)
-
-const (
- // defined by the Win32 API
- th32cs_snapprocess uintptr = 0x2
-)
-
-var (
- kernel = syscall.MustLoadDLL("kernel32.dll")
- CreateToolhelp32Snapshot = kernel.MustFindProc("CreateToolhelp32Snapshot")
- Process32First = kernel.MustFindProc("Process32FirstW")
- Process32Next = kernel.MustFindProc("Process32NextW")
-)
-
-// ProcessEntry32 structure defined by the Win32 API
-type processEntry32 struct {
- dwSize uint32
- cntUsage uint32
- th32ProcessID uint32
- th32DefaultHeapID int
- th32ModuleID uint32
- cntThreads uint32
- th32ParentProcessID uint32
- pcPriClassBase int32
- dwFlags uint32
- szExeFile [syscall.MAX_PATH]uint16
-}
-
-func getProcessEntry(pid int) (pe *processEntry32, err error) {
- snapshot, _, e1 := CreateToolhelp32Snapshot.Call(th32cs_snapprocess, uintptr(0))
- if snapshot == uintptr(syscall.InvalidHandle) {
- err = fmt.Errorf("CreateToolhelp32Snapshot: %v", e1)
- return
- }
- defer syscall.CloseHandle(syscall.Handle(snapshot))
-
- var processEntry processEntry32
- processEntry.dwSize = uint32(unsafe.Sizeof(processEntry))
- ok, _, e1 := Process32First.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
- if ok == 0 {
- err = fmt.Errorf("Process32First: %v", e1)
- return
- }
-
- for {
- if processEntry.th32ProcessID == uint32(pid) {
- pe = &processEntry
- return
- }
-
- ok, _, e1 = Process32Next.Call(snapshot, uintptr(unsafe.Pointer(&processEntry)))
- if ok == 0 {
- err = fmt.Errorf("Process32Next: %v", e1)
- return
- }
- }
-}
-
-func getppid() (pid int, err error) {
- pe, err := getProcessEntry(os.Getpid())
- if err != nil {
- return
- }
-
- pid = int(pe.th32ParentProcessID)
- return
-}
-
-// StartedByExplorer returns true if the program was invoked by the user double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
- ppid, err := getppid()
- if err != nil {
- return false
- }
-
- pe, err := getProcessEntry(ppid)
- if err != nil {
- return false
- }
-
- name := syscall.UTF16ToString(pe.szExeFile[:])
- return name == "explorer.exe"
-}
diff --git a/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go b/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
deleted file mode 100644
index 9a28e57..0000000
--- a/vendor/github.com/inconshreveable/mousetrap/trap_windows_1.4.go
+++ /dev/null
@@ -1,46 +0,0 @@
-// +build windows
-// +build go1.4
-
-package mousetrap
-
-import (
- "os"
- "syscall"
- "unsafe"
-)
-
-func getProcessEntry(pid int) (*syscall.ProcessEntry32, error) {
- snapshot, err := syscall.CreateToolhelp32Snapshot(syscall.TH32CS_SNAPPROCESS, 0)
- if err != nil {
- return nil, err
- }
- defer syscall.CloseHandle(snapshot)
- var procEntry syscall.ProcessEntry32
- procEntry.Size = uint32(unsafe.Sizeof(procEntry))
- if err = syscall.Process32First(snapshot, &procEntry); err != nil {
- return nil, err
- }
- for {
- if procEntry.ProcessID == uint32(pid) {
- return &procEntry, nil
- }
- err = syscall.Process32Next(snapshot, &procEntry)
- if err != nil {
- return nil, err
- }
- }
-}
-
-// StartedByExplorer returns true if the program was invoked by the user double-clicking
-// on the executable from explorer.exe
-//
-// It is conservative and returns false if any of the internal calls fail.
-// It does not guarantee that the program was run from a terminal. It only can tell you
-// whether it was launched from explorer.exe
-func StartedByExplorer() bool {
- pe, err := getProcessEntry(os.Getppid())
- if err != nil {
- return false
- }
- return "explorer.exe" == syscall.UTF16ToString(pe.ExeFile[:])
-}
diff --git a/vendor/github.com/pkg/errors/LICENSE b/vendor/github.com/pkg/errors/LICENSE
deleted file mode 100644
index 835ba3e..0000000
--- a/vendor/github.com/pkg/errors/LICENSE
+++ /dev/null
@@ -1,23 +0,0 @@
-Copyright (c) 2015, Dave Cheney
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are met:
-
-* Redistributions of source code must retain the above copyright notice, this
- list of conditions and the following disclaimer.
-
-* Redistributions in binary form must reproduce the above copyright notice,
- this list of conditions and the following disclaimer in the documentation
- and/or other materials provided with the distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS"
-AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE
-IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
-DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE
-FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL
-DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR
-SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER
-CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY,
-OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/pkg/errors/errors.go b/vendor/github.com/pkg/errors/errors.go
deleted file mode 100644
index 7421f32..0000000
--- a/vendor/github.com/pkg/errors/errors.go
+++ /dev/null
@@ -1,282 +0,0 @@
-// Package errors provides simple error handling primitives.
-//
-// The traditional error handling idiom in Go is roughly akin to
-//
-// if err != nil {
-// return err
-// }
-//
-// which when applied recursively up the call stack results in error reports
-// without context or debugging information. The errors package allows
-// programmers to add context to the failure path in their code in a way
-// that does not destroy the original value of the error.
-//
-// Adding context to an error
-//
-// The errors.Wrap function returns a new error that adds context to the
-// original error by recording a stack trace at the point Wrap is called,
-// together with the supplied message. For example
-//
-// _, err := ioutil.ReadAll(r)
-// if err != nil {
-// return errors.Wrap(err, "read failed")
-// }
-//
-// If additional control is required, the errors.WithStack and
-// errors.WithMessage functions destructure errors.Wrap into its component
-// operations: annotating an error with a stack trace and with a message,
-// respectively.
-//
-// Retrieving the cause of an error
-//
-// Using errors.Wrap constructs a stack of errors, adding context to the
-// preceding error. Depending on the nature of the error it may be necessary
-// to reverse the operation of errors.Wrap to retrieve the original error
-// for inspection. Any error value which implements this interface
-//
-// type causer interface {
-// Cause() error
-// }
-//
-// can be inspected by errors.Cause. errors.Cause will recursively retrieve
-// the topmost error that does not implement causer, which is assumed to be
-// the original cause. For example:
-//
-// switch err := errors.Cause(err).(type) {
-// case *MyError:
-// // handle specifically
-// default:
-// // unknown error
-// }
-//
-// Although the causer interface is not exported by this package, it is
-// considered a part of its stable public interface.
-//
-// Formatted printing of errors
-//
-// All error values returned from this package implement fmt.Formatter and can
-// be formatted by the fmt package. The following verbs are supported:
-//
-// %s print the error. If the error has a Cause it will be
-// printed recursively.
-// %v see %s
-// %+v extended format. Each Frame of the error's StackTrace will
-// be printed in detail.
-//
-// Retrieving the stack trace of an error or wrapper
-//
-// New, Errorf, Wrap, and Wrapf record a stack trace at the point they are
-// invoked. This information can be retrieved with the following interface:
-//
-// type stackTracer interface {
-// StackTrace() errors.StackTrace
-// }
-//
-// The returned errors.StackTrace type is defined as
-//
-// type StackTrace []Frame
-//
-// The Frame type represents a call site in the stack trace. Frame supports
-// the fmt.Formatter interface that can be used for printing information about
-// the stack trace of this error. For example:
-//
-// if err, ok := err.(stackTracer); ok {
-// for _, f := range err.StackTrace() {
-// fmt.Printf("%+s:%d", f)
-// }
-// }
-//
-// Although the stackTracer interface is not exported by this package, it is
-// considered a part of its stable public interface.
-//
-// See the documentation for Frame.Format for more details.
-package errors
-
-import (
- "fmt"
- "io"
-)
-
-// New returns an error with the supplied message.
-// New also records the stack trace at the point it was called.
-func New(message string) error {
- return &fundamental{
- msg: message,
- stack: callers(),
- }
-}
-
-// Errorf formats according to a format specifier and returns the string
-// as a value that satisfies error.
-// Errorf also records the stack trace at the point it was called.
-func Errorf(format string, args ...interface{}) error {
- return &fundamental{
- msg: fmt.Sprintf(format, args...),
- stack: callers(),
- }
-}
-
-// fundamental is an error that has a message and a stack, but no caller.
-type fundamental struct {
- msg string
- *stack
-}
-
-func (f *fundamental) Error() string { return f.msg }
-
-func (f *fundamental) Format(s fmt.State, verb rune) {
- switch verb {
- case 'v':
- if s.Flag('+') {
- io.WriteString(s, f.msg)
- f.stack.Format(s, verb)
- return
- }
- fallthrough
- case 's':
- io.WriteString(s, f.msg)
- case 'q':
- fmt.Fprintf(s, "%q", f.msg)
- }
-}
-
-// WithStack annotates err with a stack trace at the point WithStack was called.
-// If err is nil, WithStack returns nil.
-func WithStack(err error) error {
- if err == nil {
- return nil
- }
- return &withStack{
- err,
- callers(),
- }
-}
-
-type withStack struct {
- error
- *stack
-}
-
-func (w *withStack) Cause() error { return w.error }
-
-func (w *withStack) Format(s fmt.State, verb rune) {
- switch verb {
- case 'v':
- if s.Flag('+') {
- fmt.Fprintf(s, "%+v", w.Cause())
- w.stack.Format(s, verb)
- return
- }
- fallthrough
- case 's':
- io.WriteString(s, w.Error())
- case 'q':
- fmt.Fprintf(s, "%q", w.Error())
- }
-}
-
-// Wrap returns an error annotating err with a stack trace
-// at the point Wrap is called, and the supplied message.
-// If err is nil, Wrap returns nil.
-func Wrap(err error, message string) error {
- if err == nil {
- return nil
- }
- err = &withMessage{
- cause: err,
- msg: message,
- }
- return &withStack{
- err,
- callers(),
- }
-}
-
-// Wrapf returns an error annotating err with a stack trace
-// at the point Wrapf is called, and the format specifier.
-// If err is nil, Wrapf returns nil.
-func Wrapf(err error, format string, args ...interface{}) error {
- if err == nil {
- return nil
- }
- err = &withMessage{
- cause: err,
- msg: fmt.Sprintf(format, args...),
- }
- return &withStack{
- err,
- callers(),
- }
-}
-
-// WithMessage annotates err with a new message.
-// If err is nil, WithMessage returns nil.
-func WithMessage(err error, message string) error {
- if err == nil {
- return nil
- }
- return &withMessage{
- cause: err,
- msg: message,
- }
-}
-
-// WithMessagef annotates err with the format specifier.
-// If err is nil, WithMessagef returns nil.
-func WithMessagef(err error, format string, args ...interface{}) error {
- if err == nil {
- return nil
- }
- return &withMessage{
- cause: err,
- msg: fmt.Sprintf(format, args...),
- }
-}
-
-type withMessage struct {
- cause error
- msg string
-}
-
-func (w *withMessage) Error() string { return w.msg + ": " + w.cause.Error() }
-func (w *withMessage) Cause() error { return w.cause }
-
-func (w *withMessage) Format(s fmt.State, verb rune) {
- switch verb {
- case 'v':
- if s.Flag('+') {
- fmt.Fprintf(s, "%+v\n", w.Cause())
- io.WriteString(s, w.msg)
- return
- }
- fallthrough
- case 's', 'q':
- io.WriteString(s, w.Error())
- }
-}
-
-// Cause returns the underlying cause of the error, if possible.
-// An error value has a cause if it implements the following
-// interface:
-//
-// type causer interface {
-// Cause() error
-// }
-//
-// If the error does not implement Cause, the original error will
-// be returned. If the error is nil, nil will be returned without further
-// investigation.
-func Cause(err error) error {
- type causer interface {
- Cause() error
- }
-
- for err != nil {
- cause, ok := err.(causer)
- if !ok {
- break
- }
- err = cause.Cause()
- }
- return err
-}
diff --git a/vendor/github.com/pkg/errors/stack.go b/vendor/github.com/pkg/errors/stack.go
deleted file mode 100644
index 2874a04..0000000
--- a/vendor/github.com/pkg/errors/stack.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package errors
-
-import (
- "fmt"
- "io"
- "path"
- "runtime"
- "strings"
-)
-
-// Frame represents a program counter inside a stack frame.
-type Frame uintptr
-
-// pc returns the program counter for this frame;
-// multiple frames may have the same PC value.
-func (f Frame) pc() uintptr { return uintptr(f) - 1 }
-
-// file returns the full path to the file that contains the
-// function for this Frame's pc.
-func (f Frame) file() string {
- fn := runtime.FuncForPC(f.pc())
- if fn == nil {
- return "unknown"
- }
- file, _ := fn.FileLine(f.pc())
- return file
-}
-
-// line returns the line number of source code of the
-// function for this Frame's pc.
-func (f Frame) line() int {
- fn := runtime.FuncForPC(f.pc())
- if fn == nil {
- return 0
- }
- _, line := fn.FileLine(f.pc())
- return line
-}
-
-// Format formats the frame according to the fmt.Formatter interface.
-//
-// %s source file
-// %d source line
-// %n function name
-// %v equivalent to %s:%d
-//
-// Format accepts flags that alter the printing of some verbs, as follows:
-//
-// %+s function name and path of source file relative to the compile time
-// GOPATH separated by \n\t (\n\t)
-// %+v equivalent to %+s:%d
-func (f Frame) Format(s fmt.State, verb rune) {
- switch verb {
- case 's':
- switch {
- case s.Flag('+'):
- pc := f.pc()
- fn := runtime.FuncForPC(pc)
- if fn == nil {
- io.WriteString(s, "unknown")
- } else {
- file, _ := fn.FileLine(pc)
- fmt.Fprintf(s, "%s\n\t%s", fn.Name(), file)
- }
- default:
- io.WriteString(s, path.Base(f.file()))
- }
- case 'd':
- fmt.Fprintf(s, "%d", f.line())
- case 'n':
- name := runtime.FuncForPC(f.pc()).Name()
- io.WriteString(s, funcname(name))
- case 'v':
- f.Format(s, 's')
- io.WriteString(s, ":")
- f.Format(s, 'd')
- }
-}
-
-// StackTrace is stack of Frames from innermost (newest) to outermost (oldest).
-type StackTrace []Frame
-
-// Format formats the stack of Frames according to the fmt.Formatter interface.
-//
-// %s lists source files for each Frame in the stack
-// %v lists the source file and line number for each Frame in the stack
-//
-// Format accepts flags that alter the printing of some verbs, as follows:
-//
-// %+v Prints filename, function, and line number for each Frame in the stack.
-func (st StackTrace) Format(s fmt.State, verb rune) {
- switch verb {
- case 'v':
- switch {
- case s.Flag('+'):
- for _, f := range st {
- fmt.Fprintf(s, "\n%+v", f)
- }
- case s.Flag('#'):
- fmt.Fprintf(s, "%#v", []Frame(st))
- default:
- fmt.Fprintf(s, "%v", []Frame(st))
- }
- case 's':
- fmt.Fprintf(s, "%s", []Frame(st))
- }
-}
-
-// stack represents a stack of program counters.
-type stack []uintptr
-
-func (s *stack) Format(st fmt.State, verb rune) {
- switch verb {
- case 'v':
- switch {
- case st.Flag('+'):
- for _, pc := range *s {
- f := Frame(pc)
- fmt.Fprintf(st, "\n%+v", f)
- }
- }
- }
-}
-
-func (s *stack) StackTrace() StackTrace {
- f := make([]Frame, len(*s))
- for i := 0; i < len(f); i++ {
- f[i] = Frame((*s)[i])
- }
- return f
-}
-
-func callers() *stack {
- const depth = 32
- var pcs [depth]uintptr
- n := runtime.Callers(3, pcs[:])
- var st stack = pcs[0:n]
- return &st
-}
-
-// funcname removes the path prefix component of a function's name reported by func.Name().
-func funcname(name string) string {
- i := strings.LastIndex(name, "/")
- name = name[i+1:]
- i = strings.Index(name, ".")
- return name[i+1:]
-}
diff --git a/vendor/github.com/spf13/cobra/LICENSE.txt b/vendor/github.com/spf13/cobra/LICENSE.txt
deleted file mode 100644
index 298f0e2..0000000
--- a/vendor/github.com/spf13/cobra/LICENSE.txt
+++ /dev/null
@@ -1,174 +0,0 @@
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
diff --git a/vendor/github.com/spf13/cobra/args.go b/vendor/github.com/spf13/cobra/args.go
deleted file mode 100644
index a5d8a92..0000000
--- a/vendor/github.com/spf13/cobra/args.go
+++ /dev/null
@@ -1,89 +0,0 @@
-package cobra
-
-import (
- "fmt"
-)
-
-type PositionalArgs func(cmd *Command, args []string) error
-
-// Legacy arg validation has the following behaviour:
-// - root commands with no subcommands can take arbitrary arguments
-// - root commands with subcommands will do subcommand validity checking
-// - subcommands will always accept arbitrary arguments
-func legacyArgs(cmd *Command, args []string) error {
- // no subcommand, always take args
- if !cmd.HasSubCommands() {
- return nil
- }
-
- // root command with subcommands, do subcommand checking.
- if !cmd.HasParent() && len(args) > 0 {
- return fmt.Errorf("unknown command %q for %q%s", args[0], cmd.CommandPath(), cmd.findSuggestions(args[0]))
- }
- return nil
-}
-
-// NoArgs returns an error if any args are included.
-func NoArgs(cmd *Command, args []string) error {
- if len(args) > 0 {
- return fmt.Errorf("unknown command %q for %q", args[0], cmd.CommandPath())
- }
- return nil
-}
-
-// OnlyValidArgs returns an error if any args are not in the list of ValidArgs.
-func OnlyValidArgs(cmd *Command, args []string) error {
- if len(cmd.ValidArgs) > 0 {
- for _, v := range args {
- if !stringInSlice(v, cmd.ValidArgs) {
- return fmt.Errorf("invalid argument %q for %q%s", v, cmd.CommandPath(), cmd.findSuggestions(args[0]))
- }
- }
- }
- return nil
-}
-
-// ArbitraryArgs never returns an error.
-func ArbitraryArgs(cmd *Command, args []string) error {
- return nil
-}
-
-// MinimumNArgs returns an error if there is not at least N args.
-func MinimumNArgs(n int) PositionalArgs {
- return func(cmd *Command, args []string) error {
- if len(args) < n {
- return fmt.Errorf("requires at least %d arg(s), only received %d", n, len(args))
- }
- return nil
- }
-}
-
-// MaximumNArgs returns an error if there are more than N args.
-func MaximumNArgs(n int) PositionalArgs {
- return func(cmd *Command, args []string) error {
- if len(args) > n {
- return fmt.Errorf("accepts at most %d arg(s), received %d", n, len(args))
- }
- return nil
- }
-}
-
-// ExactArgs returns an error if there are not exactly n args.
-func ExactArgs(n int) PositionalArgs {
- return func(cmd *Command, args []string) error {
- if len(args) != n {
- return fmt.Errorf("accepts %d arg(s), received %d", n, len(args))
- }
- return nil
- }
-}
-
-// RangeArgs returns an error if the number of args is not within the expected range.
-func RangeArgs(min int, max int) PositionalArgs {
- return func(cmd *Command, args []string) error {
- if len(args) < min || len(args) > max {
- return fmt.Errorf("accepts between %d and %d arg(s), received %d", min, max, len(args))
- }
- return nil
- }
-}
diff --git a/vendor/github.com/spf13/cobra/bash_completions.go b/vendor/github.com/spf13/cobra/bash_completions.go
deleted file mode 100644
index 8fa8f48..0000000
--- a/vendor/github.com/spf13/cobra/bash_completions.go
+++ /dev/null
@@ -1,584 +0,0 @@
-package cobra
-
-import (
- "bytes"
- "fmt"
- "io"
- "os"
- "sort"
- "strings"
-
- "github.com/spf13/pflag"
-)
-
-// Annotations for Bash completion.
-const (
- BashCompFilenameExt = "cobra_annotation_bash_completion_filename_extensions"
- BashCompCustom = "cobra_annotation_bash_completion_custom"
- BashCompOneRequiredFlag = "cobra_annotation_bash_completion_one_required_flag"
- BashCompSubdirsInDir = "cobra_annotation_bash_completion_subdirs_in_dir"
-)
-
-func writePreamble(buf *bytes.Buffer, name string) {
- buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name))
- buf.WriteString(fmt.Sprintf(`
-__%[1]s_debug()
-{
- if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
- echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
- fi
-}
-
-# Homebrew on Macs have version 1.3 of bash-completion which doesn't include
-# _init_completion. This is a very minimal version of that function.
-__%[1]s_init_completion()
-{
- COMPREPLY=()
- _get_comp_words_by_ref "$@" cur prev words cword
-}
-
-__%[1]s_index_of_word()
-{
- local w word=$1
- shift
- index=0
- for w in "$@"; do
- [[ $w = "$word" ]] && return
- index=$((index+1))
- done
- index=-1
-}
-
-__%[1]s_contains_word()
-{
- local w word=$1; shift
- for w in "$@"; do
- [[ $w = "$word" ]] && return
- done
- return 1
-}
-
-__%[1]s_handle_reply()
-{
- __%[1]s_debug "${FUNCNAME[0]}"
- case $cur in
- -*)
- if [[ $(type -t compopt) = "builtin" ]]; then
- compopt -o nospace
- fi
- local allflags
- if [ ${#must_have_one_flag[@]} -ne 0 ]; then
- allflags=("${must_have_one_flag[@]}")
- else
- allflags=("${flags[*]} ${two_word_flags[*]}")
- fi
- COMPREPLY=( $(compgen -W "${allflags[*]}" -- "$cur") )
- if [[ $(type -t compopt) = "builtin" ]]; then
- [[ "${COMPREPLY[0]}" == *= ]] || compopt +o nospace
- fi
-
- # complete after --flag=abc
- if [[ $cur == *=* ]]; then
- if [[ $(type -t compopt) = "builtin" ]]; then
- compopt +o nospace
- fi
-
- local index flag
- flag="${cur%%=*}"
- __%[1]s_index_of_word "${flag}" "${flags_with_completion[@]}"
- COMPREPLY=()
- if [[ ${index} -ge 0 ]]; then
- PREFIX=""
- cur="${cur#*=}"
- ${flags_completion[${index}]}
- if [ -n "${ZSH_VERSION}" ]; then
- # zsh completion needs --flag= prefix
- eval "COMPREPLY=( \"\${COMPREPLY[@]/#/${flag}=}\" )"
- fi
- fi
- fi
- return 0;
- ;;
- esac
-
- # check if we are handling a flag with special work handling
- local index
- __%[1]s_index_of_word "${prev}" "${flags_with_completion[@]}"
- if [[ ${index} -ge 0 ]]; then
- ${flags_completion[${index}]}
- return
- fi
-
- # we are parsing a flag and don't have a special handler, no completion
- if [[ ${cur} != "${words[cword]}" ]]; then
- return
- fi
-
- local completions
- completions=("${commands[@]}")
- if [[ ${#must_have_one_noun[@]} -ne 0 ]]; then
- completions=("${must_have_one_noun[@]}")
- fi
- if [[ ${#must_have_one_flag[@]} -ne 0 ]]; then
- completions+=("${must_have_one_flag[@]}")
- fi
- COMPREPLY=( $(compgen -W "${completions[*]}" -- "$cur") )
-
- if [[ ${#COMPREPLY[@]} -eq 0 && ${#noun_aliases[@]} -gt 0 && ${#must_have_one_noun[@]} -ne 0 ]]; then
- COMPREPLY=( $(compgen -W "${noun_aliases[*]}" -- "$cur") )
- fi
-
- if [[ ${#COMPREPLY[@]} -eq 0 ]]; then
- declare -F __custom_func >/dev/null && __custom_func
- fi
-
- # available in bash-completion >= 2, not always present on macOS
- if declare -F __ltrim_colon_completions >/dev/null; then
- __ltrim_colon_completions "$cur"
- fi
-
- # If there is only 1 completion and it is a flag with an = it will be completed
- # but we don't want a space after the =
- if [[ "${#COMPREPLY[@]}" -eq "1" ]] && [[ $(type -t compopt) = "builtin" ]] && [[ "${COMPREPLY[0]}" == --*= ]]; then
- compopt -o nospace
- fi
-}
-
-# The arguments should be in the form "ext1|ext2|extn"
-__%[1]s_handle_filename_extension_flag()
-{
- local ext="$1"
- _filedir "@(${ext})"
-}
-
-__%[1]s_handle_subdirs_in_dir_flag()
-{
- local dir="$1"
- pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
-}
-
-__%[1]s_handle_flag()
-{
- __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
-
- # if a command required a flag, and we found it, unset must_have_one_flag()
- local flagname=${words[c]}
- local flagvalue
- # if the word contained an =
- if [[ ${words[c]} == *"="* ]]; then
- flagvalue=${flagname#*=} # take in as flagvalue after the =
- flagname=${flagname%%=*} # strip everything after the =
- flagname="${flagname}=" # but put the = back
- fi
- __%[1]s_debug "${FUNCNAME[0]}: looking for ${flagname}"
- if __%[1]s_contains_word "${flagname}" "${must_have_one_flag[@]}"; then
- must_have_one_flag=()
- fi
-
- # if you set a flag which only applies to this command, don't show subcommands
- if __%[1]s_contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then
- commands=()
- fi
-
- # keep flag value with flagname as flaghash
- # flaghash variable is an associative array which is only supported in bash > 3.
- if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then
- if [ -n "${flagvalue}" ] ; then
- flaghash[${flagname}]=${flagvalue}
- elif [ -n "${words[ $((c+1)) ]}" ] ; then
- flaghash[${flagname}]=${words[ $((c+1)) ]}
- else
- flaghash[${flagname}]="true" # pad "true" for bool flag
- fi
- fi
-
- # skip the argument to a two word flag
- if __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then
- c=$((c+1))
- # if we are looking for a flags value, don't show commands
- if [[ $c -eq $cword ]]; then
- commands=()
- fi
- fi
-
- c=$((c+1))
-
-}
-
-__%[1]s_handle_noun()
-{
- __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
-
- if __%[1]s_contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
- must_have_one_noun=()
- elif __%[1]s_contains_word "${words[c]}" "${noun_aliases[@]}"; then
- must_have_one_noun=()
- fi
-
- nouns+=("${words[c]}")
- c=$((c+1))
-}
-
-__%[1]s_handle_command()
-{
- __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
-
- local next_command
- if [[ -n ${last_command} ]]; then
- next_command="_${last_command}_${words[c]//:/__}"
- else
- if [[ $c -eq 0 ]]; then
- next_command="_%[1]s_root_command"
- else
- next_command="_${words[c]//:/__}"
- fi
- fi
- c=$((c+1))
- __%[1]s_debug "${FUNCNAME[0]}: looking for ${next_command}"
- declare -F "$next_command" >/dev/null && $next_command
-}
-
-__%[1]s_handle_word()
-{
- if [[ $c -ge $cword ]]; then
- __%[1]s_handle_reply
- return
- fi
- __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
- if [[ "${words[c]}" == -* ]]; then
- __%[1]s_handle_flag
- elif __%[1]s_contains_word "${words[c]}" "${commands[@]}"; then
- __%[1]s_handle_command
- elif [[ $c -eq 0 ]]; then
- __%[1]s_handle_command
- elif __%[1]s_contains_word "${words[c]}" "${command_aliases[@]}"; then
- # aliashash variable is an associative array which is only supported in bash > 3.
- if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then
- words[c]=${aliashash[${words[c]}]}
- __%[1]s_handle_command
- else
- __%[1]s_handle_noun
- fi
- else
- __%[1]s_handle_noun
- fi
- __%[1]s_handle_word
-}
-
-`, name))
-}
-
-func writePostscript(buf *bytes.Buffer, name string) {
- name = strings.Replace(name, ":", "__", -1)
- buf.WriteString(fmt.Sprintf("__start_%s()\n", name))
- buf.WriteString(fmt.Sprintf(`{
- local cur prev words cword
- declare -A flaghash 2>/dev/null || :
- declare -A aliashash 2>/dev/null || :
- if declare -F _init_completion >/dev/null 2>&1; then
- _init_completion -s || return
- else
- __%[1]s_init_completion -n "=" || return
- fi
-
- local c=0
- local flags=()
- local two_word_flags=()
- local local_nonpersistent_flags=()
- local flags_with_completion=()
- local flags_completion=()
- local commands=("%[1]s")
- local must_have_one_flag=()
- local must_have_one_noun=()
- local last_command
- local nouns=()
-
- __%[1]s_handle_word
-}
-
-`, name))
- buf.WriteString(fmt.Sprintf(`if [[ $(type -t compopt) = "builtin" ]]; then
- complete -o default -F __start_%s %s
-else
- complete -o default -o nospace -F __start_%s %s
-fi
-
-`, name, name, name, name))
- buf.WriteString("# ex: ts=4 sw=4 et filetype=sh\n")
-}
-
-func writeCommands(buf *bytes.Buffer, cmd *Command) {
- buf.WriteString(" commands=()\n")
- for _, c := range cmd.Commands() {
- if !c.IsAvailableCommand() || c == cmd.helpCommand {
- continue
- }
- buf.WriteString(fmt.Sprintf(" commands+=(%q)\n", c.Name()))
- writeCmdAliases(buf, c)
- }
- buf.WriteString("\n")
-}
-
-func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) {
- for key, value := range annotations {
- switch key {
- case BashCompFilenameExt:
- buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name))
-
- var ext string
- if len(value) > 0 {
- ext = fmt.Sprintf("__%s_handle_filename_extension_flag ", cmd.Root().Name()) + strings.Join(value, "|")
- } else {
- ext = "_filedir"
- }
- buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext))
- case BashCompCustom:
- buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name))
- if len(value) > 0 {
- handlers := strings.Join(value, "; ")
- buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", handlers))
- } else {
- buf.WriteString(" flags_completion+=(:)\n")
- }
- case BashCompSubdirsInDir:
- buf.WriteString(fmt.Sprintf(" flags_with_completion+=(%q)\n", name))
-
- var ext string
- if len(value) == 1 {
- ext = fmt.Sprintf("__%s_handle_subdirs_in_dir_flag ", cmd.Root().Name()) + value[0]
- } else {
- ext = "_filedir -d"
- }
- buf.WriteString(fmt.Sprintf(" flags_completion+=(%q)\n", ext))
- }
- }
-}
-
-func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) {
- name := flag.Shorthand
- format := " "
- if len(flag.NoOptDefVal) == 0 {
- format += "two_word_"
- }
- format += "flags+=(\"-%s\")\n"
- buf.WriteString(fmt.Sprintf(format, name))
- writeFlagHandler(buf, "-"+name, flag.Annotations, cmd)
-}
-
-func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) {
- name := flag.Name
- format := " flags+=(\"--%s"
- if len(flag.NoOptDefVal) == 0 {
- format += "="
- }
- format += "\")\n"
- buf.WriteString(fmt.Sprintf(format, name))
- writeFlagHandler(buf, "--"+name, flag.Annotations, cmd)
-}
-
-func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) {
- name := flag.Name
- format := " local_nonpersistent_flags+=(\"--%s"
- if len(flag.NoOptDefVal) == 0 {
- format += "="
- }
- format += "\")\n"
- buf.WriteString(fmt.Sprintf(format, name))
-}
-
-func writeFlags(buf *bytes.Buffer, cmd *Command) {
- buf.WriteString(` flags=()
- two_word_flags=()
- local_nonpersistent_flags=()
- flags_with_completion=()
- flags_completion=()
-
-`)
- localNonPersistentFlags := cmd.LocalNonPersistentFlags()
- cmd.NonInheritedFlags().VisitAll(func(flag *pflag.Flag) {
- if nonCompletableFlag(flag) {
- return
- }
- writeFlag(buf, flag, cmd)
- if len(flag.Shorthand) > 0 {
- writeShortFlag(buf, flag, cmd)
- }
- if localNonPersistentFlags.Lookup(flag.Name) != nil {
- writeLocalNonPersistentFlag(buf, flag)
- }
- })
- cmd.InheritedFlags().VisitAll(func(flag *pflag.Flag) {
- if nonCompletableFlag(flag) {
- return
- }
- writeFlag(buf, flag, cmd)
- if len(flag.Shorthand) > 0 {
- writeShortFlag(buf, flag, cmd)
- }
- })
-
- buf.WriteString("\n")
-}
-
-func writeRequiredFlag(buf *bytes.Buffer, cmd *Command) {
- buf.WriteString(" must_have_one_flag=()\n")
- flags := cmd.NonInheritedFlags()
- flags.VisitAll(func(flag *pflag.Flag) {
- if nonCompletableFlag(flag) {
- return
- }
- for key := range flag.Annotations {
- switch key {
- case BashCompOneRequiredFlag:
- format := " must_have_one_flag+=(\"--%s"
- if flag.Value.Type() != "bool" {
- format += "="
- }
- format += "\")\n"
- buf.WriteString(fmt.Sprintf(format, flag.Name))
-
- if len(flag.Shorthand) > 0 {
- buf.WriteString(fmt.Sprintf(" must_have_one_flag+=(\"-%s\")\n", flag.Shorthand))
- }
- }
- }
- })
-}
-
-func writeRequiredNouns(buf *bytes.Buffer, cmd *Command) {
- buf.WriteString(" must_have_one_noun=()\n")
- sort.Sort(sort.StringSlice(cmd.ValidArgs))
- for _, value := range cmd.ValidArgs {
- buf.WriteString(fmt.Sprintf(" must_have_one_noun+=(%q)\n", value))
- }
-}
-
-func writeCmdAliases(buf *bytes.Buffer, cmd *Command) {
- if len(cmd.Aliases) == 0 {
- return
- }
-
- sort.Sort(sort.StringSlice(cmd.Aliases))
-
- buf.WriteString(fmt.Sprint(` if [[ -z "${BASH_VERSION}" || "${BASH_VERSINFO[0]}" -gt 3 ]]; then`, "\n"))
- for _, value := range cmd.Aliases {
- buf.WriteString(fmt.Sprintf(" command_aliases+=(%q)\n", value))
- buf.WriteString(fmt.Sprintf(" aliashash[%q]=%q\n", value, cmd.Name()))
- }
- buf.WriteString(` fi`)
- buf.WriteString("\n")
-}
-func writeArgAliases(buf *bytes.Buffer, cmd *Command) {
- buf.WriteString(" noun_aliases=()\n")
- sort.Sort(sort.StringSlice(cmd.ArgAliases))
- for _, value := range cmd.ArgAliases {
- buf.WriteString(fmt.Sprintf(" noun_aliases+=(%q)\n", value))
- }
-}
-
-func gen(buf *bytes.Buffer, cmd *Command) {
- for _, c := range cmd.Commands() {
- if !c.IsAvailableCommand() || c == cmd.helpCommand {
- continue
- }
- gen(buf, c)
- }
- commandName := cmd.CommandPath()
- commandName = strings.Replace(commandName, " ", "_", -1)
- commandName = strings.Replace(commandName, ":", "__", -1)
-
- if cmd.Root() == cmd {
- buf.WriteString(fmt.Sprintf("_%s_root_command()\n{\n", commandName))
- } else {
- buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName))
- }
-
- buf.WriteString(fmt.Sprintf(" last_command=%q\n", commandName))
- buf.WriteString("\n")
- buf.WriteString(" command_aliases=()\n")
- buf.WriteString("\n")
-
- writeCommands(buf, cmd)
- writeFlags(buf, cmd)
- writeRequiredFlag(buf, cmd)
- writeRequiredNouns(buf, cmd)
- writeArgAliases(buf, cmd)
- buf.WriteString("}\n\n")
-}
-
-// GenBashCompletion generates bash completion file and writes to the passed writer.
-func (c *Command) GenBashCompletion(w io.Writer) error {
- buf := new(bytes.Buffer)
- writePreamble(buf, c.Name())
- if len(c.BashCompletionFunction) > 0 {
- buf.WriteString(c.BashCompletionFunction + "\n")
- }
- gen(buf, c)
- writePostscript(buf, c.Name())
-
- _, err := buf.WriteTo(w)
- return err
-}
-
-func nonCompletableFlag(flag *pflag.Flag) bool {
- return flag.Hidden || len(flag.Deprecated) > 0
-}
-
-// GenBashCompletionFile generates bash completion file.
-func (c *Command) GenBashCompletionFile(filename string) error {
- outFile, err := os.Create(filename)
- if err != nil {
- return err
- }
- defer outFile.Close()
-
- return c.GenBashCompletion(outFile)
-}
-
-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists,
-// and causes your command to report an error if invoked without the flag.
-func (c *Command) MarkFlagRequired(name string) error {
- return MarkFlagRequired(c.Flags(), name)
-}
-
-// MarkPersistentFlagRequired adds the BashCompOneRequiredFlag annotation to the named persistent flag if it exists,
-// and causes your command to report an error if invoked without the flag.
-func (c *Command) MarkPersistentFlagRequired(name string) error {
- return MarkFlagRequired(c.PersistentFlags(), name)
-}
-
-// MarkFlagRequired adds the BashCompOneRequiredFlag annotation to the named flag if it exists,
-// and causes your command to report an error if invoked without the flag.
-func MarkFlagRequired(flags *pflag.FlagSet, name string) error {
- return flags.SetAnnotation(name, BashCompOneRequiredFlag, []string{"true"})
-}
-
-// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
-func (c *Command) MarkFlagFilename(name string, extensions ...string) error {
- return MarkFlagFilename(c.Flags(), name, extensions...)
-}
-
-// MarkFlagCustom adds the BashCompCustom annotation to the named flag, if it exists.
-// Generated bash autocompletion will call the bash function f for the flag.
-func (c *Command) MarkFlagCustom(name string, f string) error {
- return MarkFlagCustom(c.Flags(), name, f)
-}
-
-// MarkPersistentFlagFilename adds the BashCompFilenameExt annotation to the named persistent flag, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
-func (c *Command) MarkPersistentFlagFilename(name string, extensions ...string) error {
- return MarkFlagFilename(c.PersistentFlags(), name, extensions...)
-}
-
-// MarkFlagFilename adds the BashCompFilenameExt annotation to the named flag in the flag set, if it exists.
-// Generated bash autocompletion will select filenames for the flag, limiting to named extensions if provided.
-func MarkFlagFilename(flags *pflag.FlagSet, name string, extensions ...string) error {
- return flags.SetAnnotation(name, BashCompFilenameExt, extensions)
-}
-
-// MarkFlagCustom adds the BashCompCustom annotation to the named flag in the flag set, if it exists.
-// Generated bash autocompletion will call the bash function f for the flag.
-func MarkFlagCustom(flags *pflag.FlagSet, name string, f string) error {
- return flags.SetAnnotation(name, BashCompCustom, []string{f})
-}
diff --git a/vendor/github.com/spf13/cobra/cobra.go b/vendor/github.com/spf13/cobra/cobra.go
deleted file mode 100644
index 7010fd1..0000000
--- a/vendor/github.com/spf13/cobra/cobra.go
+++ /dev/null
@@ -1,200 +0,0 @@
-// Copyright © 2013 Steve Francia .
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Commands similar to git, go tools and other modern CLI tools
-// inspired by go, go-Commander, gh and subcommand
-
-package cobra
-
-import (
- "fmt"
- "io"
- "reflect"
- "strconv"
- "strings"
- "text/template"
- "unicode"
-)
-
-var templateFuncs = template.FuncMap{
- "trim": strings.TrimSpace,
- "trimRightSpace": trimRightSpace,
- "trimTrailingWhitespaces": trimRightSpace,
- "appendIfNotPresent": appendIfNotPresent,
- "rpad": rpad,
- "gt": Gt,
- "eq": Eq,
-}
-
-var initializers []func()
-
-// EnablePrefixMatching allows to set automatic prefix matching. Automatic prefix matching can be a dangerous thing
-// to automatically enable in CLI tools.
-// Set this to true to enable it.
-var EnablePrefixMatching = false
-
-// EnableCommandSorting controls sorting of the slice of commands, which is turned on by default.
-// To disable sorting, set it to false.
-var EnableCommandSorting = true
-
-// MousetrapHelpText enables an information splash screen on Windows
-// if the CLI is started from explorer.exe.
-// To disable the mousetrap, just set this variable to blank string ("").
-// Works only on Microsoft Windows.
-var MousetrapHelpText string = `This is a command line tool.
-
-You need to open cmd.exe and run it from there.
-`
-
-// AddTemplateFunc adds a template function that's available to Usage and Help
-// template generation.
-func AddTemplateFunc(name string, tmplFunc interface{}) {
- templateFuncs[name] = tmplFunc
-}
-
-// AddTemplateFuncs adds multiple template functions that are available to Usage and
-// Help template generation.
-func AddTemplateFuncs(tmplFuncs template.FuncMap) {
- for k, v := range tmplFuncs {
- templateFuncs[k] = v
- }
-}
-
-// OnInitialize sets the passed functions to be run when each command's
-// Execute method is called.
-func OnInitialize(y ...func()) {
- initializers = append(initializers, y...)
-}
-
-// FIXME Gt is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra.
-
-// Gt takes two types and checks whether the first type is greater than the second. In case of types Arrays, Chans,
-// Maps and Slices, Gt will compare their lengths. Ints are compared directly while strings are first parsed as
-// ints and then compared.
-func Gt(a interface{}, b interface{}) bool {
- var left, right int64
- av := reflect.ValueOf(a)
-
- switch av.Kind() {
- case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
- left = int64(av.Len())
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- left = av.Int()
- case reflect.String:
- left, _ = strconv.ParseInt(av.String(), 10, 64)
- }
-
- bv := reflect.ValueOf(b)
-
- switch bv.Kind() {
- case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
- right = int64(bv.Len())
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- right = bv.Int()
- case reflect.String:
- right, _ = strconv.ParseInt(bv.String(), 10, 64)
- }
-
- return left > right
-}
-
-// FIXME Eq is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra.
-
-// Eq takes two types and checks whether they are equal. Supported types are int and string. Unsupported types will panic.
-func Eq(a interface{}, b interface{}) bool {
- av := reflect.ValueOf(a)
- bv := reflect.ValueOf(b)
-
- switch av.Kind() {
- case reflect.Array, reflect.Chan, reflect.Map, reflect.Slice:
- panic("Eq called on unsupported type")
- case reflect.Int, reflect.Int8, reflect.Int16, reflect.Int32, reflect.Int64:
- return av.Int() == bv.Int()
- case reflect.String:
- return av.String() == bv.String()
- }
- return false
-}
-
-func trimRightSpace(s string) string {
- return strings.TrimRightFunc(s, unicode.IsSpace)
-}
-
-// FIXME appendIfNotPresent is unused by cobra and should be removed in a version 2. It exists only for compatibility with users of cobra.
-
-// appendIfNotPresent will append stringToAppend to the end of s, but only if it's not yet present in s.
-func appendIfNotPresent(s, stringToAppend string) string {
- if strings.Contains(s, stringToAppend) {
- return s
- }
- return s + " " + stringToAppend
-}
-
-// rpad adds padding to the right of a string.
-func rpad(s string, padding int) string {
- template := fmt.Sprintf("%%-%ds", padding)
- return fmt.Sprintf(template, s)
-}
-
-// tmpl executes the given template text on data, writing the result to w.
-func tmpl(w io.Writer, text string, data interface{}) error {
- t := template.New("top")
- t.Funcs(templateFuncs)
- template.Must(t.Parse(text))
- return t.Execute(w, data)
-}
-
-// ld compares two strings and returns the levenshtein distance between them.
-func ld(s, t string, ignoreCase bool) int {
- if ignoreCase {
- s = strings.ToLower(s)
- t = strings.ToLower(t)
- }
- d := make([][]int, len(s)+1)
- for i := range d {
- d[i] = make([]int, len(t)+1)
- }
- for i := range d {
- d[i][0] = i
- }
- for j := range d[0] {
- d[0][j] = j
- }
- for j := 1; j <= len(t); j++ {
- for i := 1; i <= len(s); i++ {
- if s[i-1] == t[j-1] {
- d[i][j] = d[i-1][j-1]
- } else {
- min := d[i-1][j]
- if d[i][j-1] < min {
- min = d[i][j-1]
- }
- if d[i-1][j-1] < min {
- min = d[i-1][j-1]
- }
- d[i][j] = min + 1
- }
- }
-
- }
- return d[len(s)][len(t)]
-}
-
-func stringInSlice(a string, list []string) bool {
- for _, b := range list {
- if b == a {
- return true
- }
- }
- return false
-}
diff --git a/vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden b/vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden
deleted file mode 100644
index d645695..0000000
--- a/vendor/github.com/spf13/cobra/cobra/cmd/testdata/LICENSE.golden
+++ /dev/null
@@ -1,202 +0,0 @@
-
- Apache License
- Version 2.0, January 2004
- http://www.apache.org/licenses/
-
- TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
-
- 1. Definitions.
-
- "License" shall mean the terms and conditions for use, reproduction,
- and distribution as defined by Sections 1 through 9 of this document.
-
- "Licensor" shall mean the copyright owner or entity authorized by
- the copyright owner that is granting the License.
-
- "Legal Entity" shall mean the union of the acting entity and all
- other entities that control, are controlled by, or are under common
- control with that entity. For the purposes of this definition,
- "control" means (i) the power, direct or indirect, to cause the
- direction or management of such entity, whether by contract or
- otherwise, or (ii) ownership of fifty percent (50%) or more of the
- outstanding shares, or (iii) beneficial ownership of such entity.
-
- "You" (or "Your") shall mean an individual or Legal Entity
- exercising permissions granted by this License.
-
- "Source" form shall mean the preferred form for making modifications,
- including but not limited to software source code, documentation
- source, and configuration files.
-
- "Object" form shall mean any form resulting from mechanical
- transformation or translation of a Source form, including but
- not limited to compiled object code, generated documentation,
- and conversions to other media types.
-
- "Work" shall mean the work of authorship, whether in Source or
- Object form, made available under the License, as indicated by a
- copyright notice that is included in or attached to the work
- (an example is provided in the Appendix below).
-
- "Derivative Works" shall mean any work, whether in Source or Object
- form, that is based on (or derived from) the Work and for which the
- editorial revisions, annotations, elaborations, or other modifications
- represent, as a whole, an original work of authorship. For the purposes
- of this License, Derivative Works shall not include works that remain
- separable from, or merely link (or bind by name) to the interfaces of,
- the Work and Derivative Works thereof.
-
- "Contribution" shall mean any work of authorship, including
- the original version of the Work and any modifications or additions
- to that Work or Derivative Works thereof, that is intentionally
- submitted to Licensor for inclusion in the Work by the copyright owner
- or by an individual or Legal Entity authorized to submit on behalf of
- the copyright owner. For the purposes of this definition, "submitted"
- means any form of electronic, verbal, or written communication sent
- to the Licensor or its representatives, including but not limited to
- communication on electronic mailing lists, source code control systems,
- and issue tracking systems that are managed by, or on behalf of, the
- Licensor for the purpose of discussing and improving the Work, but
- excluding communication that is conspicuously marked or otherwise
- designated in writing by the copyright owner as "Not a Contribution."
-
- "Contributor" shall mean Licensor and any individual or Legal Entity
- on behalf of whom a Contribution has been received by Licensor and
- subsequently incorporated within the Work.
-
- 2. Grant of Copyright License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- copyright license to reproduce, prepare Derivative Works of,
- publicly display, publicly perform, sublicense, and distribute the
- Work and such Derivative Works in Source or Object form.
-
- 3. Grant of Patent License. Subject to the terms and conditions of
- this License, each Contributor hereby grants to You a perpetual,
- worldwide, non-exclusive, no-charge, royalty-free, irrevocable
- (except as stated in this section) patent license to make, have made,
- use, offer to sell, sell, import, and otherwise transfer the Work,
- where such license applies only to those patent claims licensable
- by such Contributor that are necessarily infringed by their
- Contribution(s) alone or by combination of their Contribution(s)
- with the Work to which such Contribution(s) was submitted. If You
- institute patent litigation against any entity (including a
- cross-claim or counterclaim in a lawsuit) alleging that the Work
- or a Contribution incorporated within the Work constitutes direct
- or contributory patent infringement, then any patent licenses
- granted to You under this License for that Work shall terminate
- as of the date such litigation is filed.
-
- 4. Redistribution. You may reproduce and distribute copies of the
- Work or Derivative Works thereof in any medium, with or without
- modifications, and in Source or Object form, provided that You
- meet the following conditions:
-
- (a) You must give any other recipients of the Work or
- Derivative Works a copy of this License; and
-
- (b) You must cause any modified files to carry prominent notices
- stating that You changed the files; and
-
- (c) You must retain, in the Source form of any Derivative Works
- that You distribute, all copyright, patent, trademark, and
- attribution notices from the Source form of the Work,
- excluding those notices that do not pertain to any part of
- the Derivative Works; and
-
- (d) If the Work includes a "NOTICE" text file as part of its
- distribution, then any Derivative Works that You distribute must
- include a readable copy of the attribution notices contained
- within such NOTICE file, excluding those notices that do not
- pertain to any part of the Derivative Works, in at least one
- of the following places: within a NOTICE text file distributed
- as part of the Derivative Works; within the Source form or
- documentation, if provided along with the Derivative Works; or,
- within a display generated by the Derivative Works, if and
- wherever such third-party notices normally appear. The contents
- of the NOTICE file are for informational purposes only and
- do not modify the License. You may add Your own attribution
- notices within Derivative Works that You distribute, alongside
- or as an addendum to the NOTICE text from the Work, provided
- that such additional attribution notices cannot be construed
- as modifying the License.
-
- You may add Your own copyright statement to Your modifications and
- may provide additional or different license terms and conditions
- for use, reproduction, or distribution of Your modifications, or
- for any such Derivative Works as a whole, provided Your use,
- reproduction, and distribution of the Work otherwise complies with
- the conditions stated in this License.
-
- 5. Submission of Contributions. Unless You explicitly state otherwise,
- any Contribution intentionally submitted for inclusion in the Work
- by You to the Licensor shall be under the terms and conditions of
- this License, without any additional terms or conditions.
- Notwithstanding the above, nothing herein shall supersede or modify
- the terms of any separate license agreement you may have executed
- with Licensor regarding such Contributions.
-
- 6. Trademarks. This License does not grant permission to use the trade
- names, trademarks, service marks, or product names of the Licensor,
- except as required for reasonable and customary use in describing the
- origin of the Work and reproducing the content of the NOTICE file.
-
- 7. Disclaimer of Warranty. Unless required by applicable law or
- agreed to in writing, Licensor provides the Work (and each
- Contributor provides its Contributions) on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
- implied, including, without limitation, any warranties or conditions
- of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
- PARTICULAR PURPOSE. You are solely responsible for determining the
- appropriateness of using or redistributing the Work and assume any
- risks associated with Your exercise of permissions under this License.
-
- 8. Limitation of Liability. In no event and under no legal theory,
- whether in tort (including negligence), contract, or otherwise,
- unless required by applicable law (such as deliberate and grossly
- negligent acts) or agreed to in writing, shall any Contributor be
- liable to You for damages, including any direct, indirect, special,
- incidental, or consequential damages of any character arising as a
- result of this License or out of the use or inability to use the
- Work (including but not limited to damages for loss of goodwill,
- work stoppage, computer failure or malfunction, or any and all
- other commercial damages or losses), even if such Contributor
- has been advised of the possibility of such damages.
-
- 9. Accepting Warranty or Additional Liability. While redistributing
- the Work or Derivative Works thereof, You may choose to offer,
- and charge a fee for, acceptance of support, warranty, indemnity,
- or other liability obligations and/or rights consistent with this
- License. However, in accepting such obligations, You may act only
- on Your own behalf and on Your sole responsibility, not on behalf
- of any other Contributor, and only if You agree to indemnify,
- defend, and hold each Contributor harmless for any liability
- incurred by, or claims asserted against, such Contributor by reason
- of your accepting any such warranty or additional liability.
-
- END OF TERMS AND CONDITIONS
-
- APPENDIX: How to apply the Apache License to your work.
-
- To apply the Apache License to your work, attach the following
- boilerplate notice, with the fields enclosed by brackets "[]"
- replaced with your own identifying information. (Don't include
- the brackets!) The text should be enclosed in the appropriate
- comment syntax for the file format. We also recommend that a
- file or class name and description of purpose be included on the
- same "printed page" as the copyright notice for easier
- identification within third-party archives.
-
- Copyright [yyyy] [name of copyright owner]
-
- Licensed under the Apache License, Version 2.0 (the "License");
- you may not use this file except in compliance with the License.
- You may obtain a copy of the License at
-
- http://www.apache.org/licenses/LICENSE-2.0
-
- Unless required by applicable law or agreed to in writing, software
- distributed under the License is distributed on an "AS IS" BASIS,
- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- See the License for the specific language governing permissions and
- limitations under the License.
diff --git a/vendor/github.com/spf13/cobra/command.go b/vendor/github.com/spf13/cobra/command.go
deleted file mode 100644
index 34d1bf3..0000000
--- a/vendor/github.com/spf13/cobra/command.go
+++ /dev/null
@@ -1,1517 +0,0 @@
-// Copyright © 2013 Steve Francia .
-//
-// Licensed under the Apache License, Version 2.0 (the "License");
-// you may not use this file except in compliance with the License.
-// You may obtain a copy of the License at
-// http://www.apache.org/licenses/LICENSE-2.0
-//
-// Unless required by applicable law or agreed to in writing, software
-// distributed under the License is distributed on an "AS IS" BASIS,
-// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
-// See the License for the specific language governing permissions and
-// limitations under the License.
-
-// Package cobra is a commander providing a simple interface to create powerful modern CLI interfaces.
-// In addition to providing an interface, Cobra simultaneously provides a controller to organize your application code.
-package cobra
-
-import (
- "bytes"
- "fmt"
- "io"
- "os"
- "path/filepath"
- "sort"
- "strings"
-
- flag "github.com/spf13/pflag"
-)
-
-// FParseErrWhitelist configures Flag parse errors to be ignored
-type FParseErrWhitelist flag.ParseErrorsWhitelist
-
-// Command is just that, a command for your application.
-// E.g. 'go run ...' - 'run' is the command. Cobra requires
-// you to define the usage and description as part of your command
-// definition to ensure usability.
-type Command struct {
- // Use is the one-line usage message.
- Use string
-
- // Aliases is an array of aliases that can be used instead of the first word in Use.
- Aliases []string
-
- // SuggestFor is an array of command names for which this command will be suggested -
- // similar to aliases but only suggests.
- SuggestFor []string
-
- // Short is the short description shown in the 'help' output.
- Short string
-
- // Long is the long message shown in the 'help ' output.
- Long string
-
- // Example is examples of how to use the command.
- Example string
-
- // ValidArgs is list of all valid non-flag arguments that are accepted in bash completions
- ValidArgs []string
-
- // Expected arguments
- Args PositionalArgs
-
- // ArgAliases is List of aliases for ValidArgs.
- // These are not suggested to the user in the bash completion,
- // but accepted if entered manually.
- ArgAliases []string
-
- // BashCompletionFunction is custom functions used by the bash autocompletion generator.
- BashCompletionFunction string
-
- // Deprecated defines, if this command is deprecated and should print this string when used.
- Deprecated string
-
- // Hidden defines, if this command is hidden and should NOT show up in the list of available commands.
- Hidden bool
-
- // Annotations are key/value pairs that can be used by applications to identify or
- // group commands.
- Annotations map[string]string
-
- // Version defines the version for this command. If this value is non-empty and the command does not
- // define a "version" flag, a "version" boolean flag will be added to the command and, if specified,
- // will print content of the "Version" variable.
- Version string
-
- // The *Run functions are executed in the following order:
- // * PersistentPreRun()
- // * PreRun()
- // * Run()
- // * PostRun()
- // * PersistentPostRun()
- // All functions get the same args, the arguments after the command name.
- //
- // PersistentPreRun: children of this command will inherit and execute.
- PersistentPreRun func(cmd *Command, args []string)
- // PersistentPreRunE: PersistentPreRun but returns an error.
- PersistentPreRunE func(cmd *Command, args []string) error
- // PreRun: children of this command will not inherit.
- PreRun func(cmd *Command, args []string)
- // PreRunE: PreRun but returns an error.
- PreRunE func(cmd *Command, args []string) error
- // Run: Typically the actual work function. Most commands will only implement this.
- Run func(cmd *Command, args []string)
- // RunE: Run but returns an error.
- RunE func(cmd *Command, args []string) error
- // PostRun: run after the Run command.
- PostRun func(cmd *Command, args []string)
- // PostRunE: PostRun but returns an error.
- PostRunE func(cmd *Command, args []string) error
- // PersistentPostRun: children of this command will inherit and execute after PostRun.
- PersistentPostRun func(cmd *Command, args []string)
- // PersistentPostRunE: PersistentPostRun but returns an error.
- PersistentPostRunE func(cmd *Command, args []string) error
-
- // SilenceErrors is an option to quiet errors down stream.
- SilenceErrors bool
-
- // SilenceUsage is an option to silence usage when an error occurs.
- SilenceUsage bool
-
- // DisableFlagParsing disables the flag parsing.
- // If this is true all flags will be passed to the command as arguments.
- DisableFlagParsing bool
-
- // DisableAutoGenTag defines, if gen tag ("Auto generated by spf13/cobra...")
- // will be printed by generating docs for this command.
- DisableAutoGenTag bool
-
- // DisableFlagsInUseLine will disable the addition of [flags] to the usage
- // line of a command when printing help or generating docs
- DisableFlagsInUseLine bool
-
- // DisableSuggestions disables the suggestions based on Levenshtein distance
- // that go along with 'unknown command' messages.
- DisableSuggestions bool
- // SuggestionsMinimumDistance defines minimum levenshtein distance to display suggestions.
- // Must be > 0.
- SuggestionsMinimumDistance int
-
- // TraverseChildren parses flags on all parents before executing child command.
- TraverseChildren bool
-
- //FParseErrWhitelist flag parse errors to be ignored
- FParseErrWhitelist FParseErrWhitelist
-
- // commands is the list of commands supported by this program.
- commands []*Command
- // parent is a parent command for this command.
- parent *Command
- // Max lengths of commands' string lengths for use in padding.
- commandsMaxUseLen int
- commandsMaxCommandPathLen int
- commandsMaxNameLen int
- // commandsAreSorted defines, if command slice are sorted or not.
- commandsAreSorted bool
- // commandCalledAs is the name or alias value used to call this command.
- commandCalledAs struct {
- name string
- called bool
- }
-
- // args is actual args parsed from flags.
- args []string
- // flagErrorBuf contains all error messages from pflag.
- flagErrorBuf *bytes.Buffer
- // flags is full set of flags.
- flags *flag.FlagSet
- // pflags contains persistent flags.
- pflags *flag.FlagSet
- // lflags contains local flags.
- lflags *flag.FlagSet
- // iflags contains inherited flags.
- iflags *flag.FlagSet
- // parentsPflags is all persistent flags of cmd's parents.
- parentsPflags *flag.FlagSet
- // globNormFunc is the global normalization function
- // that we can use on every pflag set and children commands
- globNormFunc func(f *flag.FlagSet, name string) flag.NormalizedName
-
- // output is an output writer defined by user.
- output io.Writer
- // usageFunc is usage func defined by user.
- usageFunc func(*Command) error
- // usageTemplate is usage template defined by user.
- usageTemplate string
- // flagErrorFunc is func defined by user and it's called when the parsing of
- // flags returns an error.
- flagErrorFunc func(*Command, error) error
- // helpTemplate is help template defined by user.
- helpTemplate string
- // helpFunc is help func defined by user.
- helpFunc func(*Command, []string)
- // helpCommand is command with usage 'help'. If it's not defined by user,
- // cobra uses default help command.
- helpCommand *Command
- // versionTemplate is the version template defined by user.
- versionTemplate string
-}
-
-// SetArgs sets arguments for the command. It is set to os.Args[1:] by default, if desired, can be overridden
-// particularly useful when testing.
-func (c *Command) SetArgs(a []string) {
- c.args = a
-}
-
-// SetOutput sets the destination for usage and error messages.
-// If output is nil, os.Stderr is used.
-func (c *Command) SetOutput(output io.Writer) {
- c.output = output
-}
-
-// SetUsageFunc sets usage function. Usage can be defined by application.
-func (c *Command) SetUsageFunc(f func(*Command) error) {
- c.usageFunc = f
-}
-
-// SetUsageTemplate sets usage template. Can be defined by Application.
-func (c *Command) SetUsageTemplate(s string) {
- c.usageTemplate = s
-}
-
-// SetFlagErrorFunc sets a function to generate an error when flag parsing
-// fails.
-func (c *Command) SetFlagErrorFunc(f func(*Command, error) error) {
- c.flagErrorFunc = f
-}
-
-// SetHelpFunc sets help function. Can be defined by Application.
-func (c *Command) SetHelpFunc(f func(*Command, []string)) {
- c.helpFunc = f
-}
-
-// SetHelpCommand sets help command.
-func (c *Command) SetHelpCommand(cmd *Command) {
- c.helpCommand = cmd
-}
-
-// SetHelpTemplate sets help template to be used. Application can use it to set custom template.
-func (c *Command) SetHelpTemplate(s string) {
- c.helpTemplate = s
-}
-
-// SetVersionTemplate sets version template to be used. Application can use it to set custom template.
-func (c *Command) SetVersionTemplate(s string) {
- c.versionTemplate = s
-}
-
-// SetGlobalNormalizationFunc sets a normalization function to all flag sets and also to child commands.
-// The user should not have a cyclic dependency on commands.
-func (c *Command) SetGlobalNormalizationFunc(n func(f *flag.FlagSet, name string) flag.NormalizedName) {
- c.Flags().SetNormalizeFunc(n)
- c.PersistentFlags().SetNormalizeFunc(n)
- c.globNormFunc = n
-
- for _, command := range c.commands {
- command.SetGlobalNormalizationFunc(n)
- }
-}
-
-// OutOrStdout returns output to stdout.
-func (c *Command) OutOrStdout() io.Writer {
- return c.getOut(os.Stdout)
-}
-
-// OutOrStderr returns output to stderr
-func (c *Command) OutOrStderr() io.Writer {
- return c.getOut(os.Stderr)
-}
-
-func (c *Command) getOut(def io.Writer) io.Writer {
- if c.output != nil {
- return c.output
- }
- if c.HasParent() {
- return c.parent.getOut(def)
- }
- return def
-}
-
-// UsageFunc returns either the function set by SetUsageFunc for this command
-// or a parent, or it returns a default usage function.
-func (c *Command) UsageFunc() (f func(*Command) error) {
- if c.usageFunc != nil {
- return c.usageFunc
- }
- if c.HasParent() {
- return c.Parent().UsageFunc()
- }
- return func(c *Command) error {
- c.mergePersistentFlags()
- err := tmpl(c.OutOrStderr(), c.UsageTemplate(), c)
- if err != nil {
- c.Println(err)
- }
- return err
- }
-}
-
-// Usage puts out the usage for the command.
-// Used when a user provides invalid input.
-// Can be defined by user by overriding UsageFunc.
-func (c *Command) Usage() error {
- return c.UsageFunc()(c)
-}
-
-// HelpFunc returns either the function set by SetHelpFunc for this command
-// or a parent, or it returns a function with default help behavior.
-func (c *Command) HelpFunc() func(*Command, []string) {
- if c.helpFunc != nil {
- return c.helpFunc
- }
- if c.HasParent() {
- return c.Parent().HelpFunc()
- }
- return func(c *Command, a []string) {
- c.mergePersistentFlags()
- err := tmpl(c.OutOrStdout(), c.HelpTemplate(), c)
- if err != nil {
- c.Println(err)
- }
- }
-}
-
-// Help puts out the help for the command.
-// Used when a user calls help [command].
-// Can be defined by user by overriding HelpFunc.
-func (c *Command) Help() error {
- c.HelpFunc()(c, []string{})
- return nil
-}
-
-// UsageString return usage string.
-func (c *Command) UsageString() string {
- tmpOutput := c.output
- bb := new(bytes.Buffer)
- c.SetOutput(bb)
- c.Usage()
- c.output = tmpOutput
- return bb.String()
-}
-
-// FlagErrorFunc returns either the function set by SetFlagErrorFunc for this
-// command or a parent, or it returns a function which returns the original
-// error.
-func (c *Command) FlagErrorFunc() (f func(*Command, error) error) {
- if c.flagErrorFunc != nil {
- return c.flagErrorFunc
- }
-
- if c.HasParent() {
- return c.parent.FlagErrorFunc()
- }
- return func(c *Command, err error) error {
- return err
- }
-}
-
-var minUsagePadding = 25
-
-// UsagePadding return padding for the usage.
-func (c *Command) UsagePadding() int {
- if c.parent == nil || minUsagePadding > c.parent.commandsMaxUseLen {
- return minUsagePadding
- }
- return c.parent.commandsMaxUseLen
-}
-
-var minCommandPathPadding = 11
-
-// CommandPathPadding return padding for the command path.
-func (c *Command) CommandPathPadding() int {
- if c.parent == nil || minCommandPathPadding > c.parent.commandsMaxCommandPathLen {
- return minCommandPathPadding
- }
- return c.parent.commandsMaxCommandPathLen
-}
-
-var minNamePadding = 11
-
-// NamePadding returns padding for the name.
-func (c *Command) NamePadding() int {
- if c.parent == nil || minNamePadding > c.parent.commandsMaxNameLen {
- return minNamePadding
- }
- return c.parent.commandsMaxNameLen
-}
-
-// UsageTemplate returns usage template for the command.
-func (c *Command) UsageTemplate() string {
- if c.usageTemplate != "" {
- return c.usageTemplate
- }
-
- if c.HasParent() {
- return c.parent.UsageTemplate()
- }
- return `Usage:{{if .Runnable}}
- {{.UseLine}}{{end}}{{if .HasAvailableSubCommands}}
- {{.CommandPath}} [command]{{end}}{{if gt (len .Aliases) 0}}
-
-Aliases:
- {{.NameAndAliases}}{{end}}{{if .HasExample}}
-
-Examples:
-{{.Example}}{{end}}{{if .HasAvailableSubCommands}}
-
-Available Commands:{{range .Commands}}{{if (or .IsAvailableCommand (eq .Name "help"))}}
- {{rpad .Name .NamePadding }} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableLocalFlags}}
-
-Flags:
-{{.LocalFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasAvailableInheritedFlags}}
-
-Global Flags:
-{{.InheritedFlags.FlagUsages | trimTrailingWhitespaces}}{{end}}{{if .HasHelpSubCommands}}
-
-Additional help topics:{{range .Commands}}{{if .IsAdditionalHelpTopicCommand}}
- {{rpad .CommandPath .CommandPathPadding}} {{.Short}}{{end}}{{end}}{{end}}{{if .HasAvailableSubCommands}}
-
-Use "{{.CommandPath}} [command] --help" for more information about a command.{{end}}
-`
-}
-
-// HelpTemplate return help template for the command.
-func (c *Command) HelpTemplate() string {
- if c.helpTemplate != "" {
- return c.helpTemplate
- }
-
- if c.HasParent() {
- return c.parent.HelpTemplate()
- }
- return `{{with (or .Long .Short)}}{{. | trimTrailingWhitespaces}}
-
-{{end}}{{if or .Runnable .HasSubCommands}}{{.UsageString}}{{end}}`
-}
-
-// VersionTemplate return version template for the command.
-func (c *Command) VersionTemplate() string {
- if c.versionTemplate != "" {
- return c.versionTemplate
- }
-
- if c.HasParent() {
- return c.parent.VersionTemplate()
- }
- return `{{with .Name}}{{printf "%s " .}}{{end}}{{printf "version %s" .Version}}
-`
-}
-
-func hasNoOptDefVal(name string, fs *flag.FlagSet) bool {
- flag := fs.Lookup(name)
- if flag == nil {
- return false
- }
- return flag.NoOptDefVal != ""
-}
-
-func shortHasNoOptDefVal(name string, fs *flag.FlagSet) bool {
- if len(name) == 0 {
- return false
- }
-
- flag := fs.ShorthandLookup(name[:1])
- if flag == nil {
- return false
- }
- return flag.NoOptDefVal != ""
-}
-
-func stripFlags(args []string, c *Command) []string {
- if len(args) == 0 {
- return args
- }
- c.mergePersistentFlags()
-
- commands := []string{}
- flags := c.Flags()
-
-Loop:
- for len(args) > 0 {
- s := args[0]
- args = args[1:]
- switch {
- case s == "--":
- // "--" terminates the flags
- break Loop
- case strings.HasPrefix(s, "--") && !strings.Contains(s, "=") && !hasNoOptDefVal(s[2:], flags):
- // If '--flag arg' then
- // delete arg from args.
- fallthrough // (do the same as below)
- case strings.HasPrefix(s, "-") && !strings.Contains(s, "=") && len(s) == 2 && !shortHasNoOptDefVal(s[1:], flags):
- // If '-f arg' then
- // delete 'arg' from args or break the loop if len(args) <= 1.
- if len(args) <= 1 {
- break Loop
- } else {
- args = args[1:]
- continue
- }
- case s != "" && !strings.HasPrefix(s, "-"):
- commands = append(commands, s)
- }
- }
-
- return commands
-}
-
-// argsMinusFirstX removes only the first x from args. Otherwise, commands that look like
-// openshift admin policy add-role-to-user admin my-user, lose the admin argument (arg[4]).
-func argsMinusFirstX(args []string, x string) []string {
- for i, y := range args {
- if x == y {
- ret := []string{}
- ret = append(ret, args[:i]...)
- ret = append(ret, args[i+1:]...)
- return ret
- }
- }
- return args
-}
-
-func isFlagArg(arg string) bool {
- return ((len(arg) >= 3 && arg[1] == '-') ||
- (len(arg) >= 2 && arg[0] == '-' && arg[1] != '-'))
-}
-
-// Find the target command given the args and command tree
-// Meant to be run on the highest node. Only searches down.
-func (c *Command) Find(args []string) (*Command, []string, error) {
- var innerfind func(*Command, []string) (*Command, []string)
-
- innerfind = func(c *Command, innerArgs []string) (*Command, []string) {
- argsWOflags := stripFlags(innerArgs, c)
- if len(argsWOflags) == 0 {
- return c, innerArgs
- }
- nextSubCmd := argsWOflags[0]
-
- cmd := c.findNext(nextSubCmd)
- if cmd != nil {
- return innerfind(cmd, argsMinusFirstX(innerArgs, nextSubCmd))
- }
- return c, innerArgs
- }
-
- commandFound, a := innerfind(c, args)
- if commandFound.Args == nil {
- return commandFound, a, legacyArgs(commandFound, stripFlags(a, commandFound))
- }
- return commandFound, a, nil
-}
-
-func (c *Command) findSuggestions(arg string) string {
- if c.DisableSuggestions {
- return ""
- }
- if c.SuggestionsMinimumDistance <= 0 {
- c.SuggestionsMinimumDistance = 2
- }
- suggestionsString := ""
- if suggestions := c.SuggestionsFor(arg); len(suggestions) > 0 {
- suggestionsString += "\n\nDid you mean this?\n"
- for _, s := range suggestions {
- suggestionsString += fmt.Sprintf("\t%v\n", s)
- }
- }
- return suggestionsString
-}
-
-func (c *Command) findNext(next string) *Command {
- matches := make([]*Command, 0)
- for _, cmd := range c.commands {
- if cmd.Name() == next || cmd.HasAlias(next) {
- cmd.commandCalledAs.name = next
- return cmd
- }
- if EnablePrefixMatching && cmd.hasNameOrAliasPrefix(next) {
- matches = append(matches, cmd)
- }
- }
-
- if len(matches) == 1 {
- return matches[0]
- }
-
- return nil
-}
-
-// Traverse the command tree to find the command, and parse args for
-// each parent.
-func (c *Command) Traverse(args []string) (*Command, []string, error) {
- flags := []string{}
- inFlag := false
-
- for i, arg := range args {
- switch {
- // A long flag with a space separated value
- case strings.HasPrefix(arg, "--") && !strings.Contains(arg, "="):
- // TODO: this isn't quite right, we should really check ahead for 'true' or 'false'
- inFlag = !hasNoOptDefVal(arg[2:], c.Flags())
- flags = append(flags, arg)
- continue
- // A short flag with a space separated value
- case strings.HasPrefix(arg, "-") && !strings.Contains(arg, "=") && len(arg) == 2 && !shortHasNoOptDefVal(arg[1:], c.Flags()):
- inFlag = true
- flags = append(flags, arg)
- continue
- // The value for a flag
- case inFlag:
- inFlag = false
- flags = append(flags, arg)
- continue
- // A flag without a value, or with an `=` separated value
- case isFlagArg(arg):
- flags = append(flags, arg)
- continue
- }
-
- cmd := c.findNext(arg)
- if cmd == nil {
- return c, args, nil
- }
-
- if err := c.ParseFlags(flags); err != nil {
- return nil, args, err
- }
- return cmd.Traverse(args[i+1:])
- }
- return c, args, nil
-}
-
-// SuggestionsFor provides suggestions for the typedName.
-func (c *Command) SuggestionsFor(typedName string) []string {
- suggestions := []string{}
- for _, cmd := range c.commands {
- if cmd.IsAvailableCommand() {
- levenshteinDistance := ld(typedName, cmd.Name(), true)
- suggestByLevenshtein := levenshteinDistance <= c.SuggestionsMinimumDistance
- suggestByPrefix := strings.HasPrefix(strings.ToLower(cmd.Name()), strings.ToLower(typedName))
- if suggestByLevenshtein || suggestByPrefix {
- suggestions = append(suggestions, cmd.Name())
- }
- for _, explicitSuggestion := range cmd.SuggestFor {
- if strings.EqualFold(typedName, explicitSuggestion) {
- suggestions = append(suggestions, cmd.Name())
- }
- }
- }
- }
- return suggestions
-}
-
-// VisitParents visits all parents of the command and invokes fn on each parent.
-func (c *Command) VisitParents(fn func(*Command)) {
- if c.HasParent() {
- fn(c.Parent())
- c.Parent().VisitParents(fn)
- }
-}
-
-// Root finds root command.
-func (c *Command) Root() *Command {
- if c.HasParent() {
- return c.Parent().Root()
- }
- return c
-}
-
-// ArgsLenAtDash will return the length of c.Flags().Args at the moment
-// when a -- was found during args parsing.
-func (c *Command) ArgsLenAtDash() int {
- return c.Flags().ArgsLenAtDash()
-}
-
-func (c *Command) execute(a []string) (err error) {
- if c == nil {
- return fmt.Errorf("Called Execute() on a nil Command")
- }
-
- if len(c.Deprecated) > 0 {
- c.Printf("Command %q is deprecated, %s\n", c.Name(), c.Deprecated)
- }
-
- // initialize help and version flag at the last point possible to allow for user
- // overriding
- c.InitDefaultHelpFlag()
- c.InitDefaultVersionFlag()
-
- err = c.ParseFlags(a)
- if err != nil {
- return c.FlagErrorFunc()(c, err)
- }
-
- // If help is called, regardless of other flags, return we want help.
- // Also say we need help if the command isn't runnable.
- helpVal, err := c.Flags().GetBool("help")
- if err != nil {
- // should be impossible to get here as we always declare a help
- // flag in InitDefaultHelpFlag()
- c.Println("\"help\" flag declared as non-bool. Please correct your code")
- return err
- }
-
- if helpVal {
- return flag.ErrHelp
- }
-
- // for back-compat, only add version flag behavior if version is defined
- if c.Version != "" {
- versionVal, err := c.Flags().GetBool("version")
- if err != nil {
- c.Println("\"version\" flag declared as non-bool. Please correct your code")
- return err
- }
- if versionVal {
- err := tmpl(c.OutOrStdout(), c.VersionTemplate(), c)
- if err != nil {
- c.Println(err)
- }
- return err
- }
- }
-
- if !c.Runnable() {
- return flag.ErrHelp
- }
-
- c.preRun()
-
- argWoFlags := c.Flags().Args()
- if c.DisableFlagParsing {
- argWoFlags = a
- }
-
- if err := c.ValidateArgs(argWoFlags); err != nil {
- return err
- }
-
- for p := c; p != nil; p = p.Parent() {
- if p.PersistentPreRunE != nil {
- if err := p.PersistentPreRunE(c, argWoFlags); err != nil {
- return err
- }
- break
- } else if p.PersistentPreRun != nil {
- p.PersistentPreRun(c, argWoFlags)
- break
- }
- }
- if c.PreRunE != nil {
- if err := c.PreRunE(c, argWoFlags); err != nil {
- return err
- }
- } else if c.PreRun != nil {
- c.PreRun(c, argWoFlags)
- }
-
- if err := c.validateRequiredFlags(); err != nil {
- return err
- }
- if c.RunE != nil {
- if err := c.RunE(c, argWoFlags); err != nil {
- return err
- }
- } else {
- c.Run(c, argWoFlags)
- }
- if c.PostRunE != nil {
- if err := c.PostRunE(c, argWoFlags); err != nil {
- return err
- }
- } else if c.PostRun != nil {
- c.PostRun(c, argWoFlags)
- }
- for p := c; p != nil; p = p.Parent() {
- if p.PersistentPostRunE != nil {
- if err := p.PersistentPostRunE(c, argWoFlags); err != nil {
- return err
- }
- break
- } else if p.PersistentPostRun != nil {
- p.PersistentPostRun(c, argWoFlags)
- break
- }
- }
-
- return nil
-}
-
-func (c *Command) preRun() {
- for _, x := range initializers {
- x()
- }
-}
-
-// Execute uses the args (os.Args[1:] by default)
-// and run through the command tree finding appropriate matches
-// for commands and then corresponding flags.
-func (c *Command) Execute() error {
- _, err := c.ExecuteC()
- return err
-}
-
-// ExecuteC executes the command.
-func (c *Command) ExecuteC() (cmd *Command, err error) {
- // Regardless of what command execute is called on, run on Root only
- if c.HasParent() {
- return c.Root().ExecuteC()
- }
-
- // windows hook
- if preExecHookFn != nil {
- preExecHookFn(c)
- }
-
- // initialize help as the last point possible to allow for user
- // overriding
- c.InitDefaultHelpCmd()
-
- var args []string
-
- // Workaround FAIL with "go test -v" or "cobra.test -test.v", see #155
- if c.args == nil && filepath.Base(os.Args[0]) != "cobra.test" {
- args = os.Args[1:]
- } else {
- args = c.args
- }
-
- var flags []string
- if c.TraverseChildren {
- cmd, flags, err = c.Traverse(args)
- } else {
- cmd, flags, err = c.Find(args)
- }
- if err != nil {
- // If found parse to a subcommand and then failed, talk about the subcommand
- if cmd != nil {
- c = cmd
- }
- if !c.SilenceErrors {
- c.Println("Error:", err.Error())
- c.Printf("Run '%v --help' for usage.\n", c.CommandPath())
- }
- return c, err
- }
-
- cmd.commandCalledAs.called = true
- if cmd.commandCalledAs.name == "" {
- cmd.commandCalledAs.name = cmd.Name()
- }
-
- err = cmd.execute(flags)
- if err != nil {
- // Always show help if requested, even if SilenceErrors is in
- // effect
- if err == flag.ErrHelp {
- cmd.HelpFunc()(cmd, args)
- return cmd, nil
- }
-
- // If root command has SilentErrors flagged,
- // all subcommands should respect it
- if !cmd.SilenceErrors && !c.SilenceErrors {
- c.Println("Error:", err.Error())
- }
-
- // If root command has SilentUsage flagged,
- // all subcommands should respect it
- if !cmd.SilenceUsage && !c.SilenceUsage {
- c.Println(cmd.UsageString())
- }
- }
- return cmd, err
-}
-
-func (c *Command) ValidateArgs(args []string) error {
- if c.Args == nil {
- return nil
- }
- return c.Args(c, args)
-}
-
-func (c *Command) validateRequiredFlags() error {
- flags := c.Flags()
- missingFlagNames := []string{}
- flags.VisitAll(func(pflag *flag.Flag) {
- requiredAnnotation, found := pflag.Annotations[BashCompOneRequiredFlag]
- if !found {
- return
- }
- if (requiredAnnotation[0] == "true") && !pflag.Changed {
- missingFlagNames = append(missingFlagNames, pflag.Name)
- }
- })
-
- if len(missingFlagNames) > 0 {
- return fmt.Errorf(`required flag(s) "%s" not set`, strings.Join(missingFlagNames, `", "`))
- }
- return nil
-}
-
-// InitDefaultHelpFlag adds default help flag to c.
-// It is called automatically by executing the c or by calling help and usage.
-// If c already has help flag, it will do nothing.
-func (c *Command) InitDefaultHelpFlag() {
- c.mergePersistentFlags()
- if c.Flags().Lookup("help") == nil {
- usage := "help for "
- if c.Name() == "" {
- usage += "this command"
- } else {
- usage += c.Name()
- }
- c.Flags().BoolP("help", "h", false, usage)
- }
-}
-
-// InitDefaultVersionFlag adds default version flag to c.
-// It is called automatically by executing the c.
-// If c already has a version flag, it will do nothing.
-// If c.Version is empty, it will do nothing.
-func (c *Command) InitDefaultVersionFlag() {
- if c.Version == "" {
- return
- }
-
- c.mergePersistentFlags()
- if c.Flags().Lookup("version") == nil {
- usage := "version for "
- if c.Name() == "" {
- usage += "this command"
- } else {
- usage += c.Name()
- }
- c.Flags().Bool("version", false, usage)
- }
-}
-
-// InitDefaultHelpCmd adds default help command to c.
-// It is called automatically by executing the c or by calling help and usage.
-// If c already has help command or c has no subcommands, it will do nothing.
-func (c *Command) InitDefaultHelpCmd() {
- if !c.HasSubCommands() {
- return
- }
-
- if c.helpCommand == nil {
- c.helpCommand = &Command{
- Use: "help [command]",
- Short: "Help about any command",
- Long: `Help provides help for any command in the application.
-Simply type ` + c.Name() + ` help [path to command] for full details.`,
-
- Run: func(c *Command, args []string) {
- cmd, _, e := c.Root().Find(args)
- if cmd == nil || e != nil {
- c.Printf("Unknown help topic %#q\n", args)
- c.Root().Usage()
- } else {
- cmd.InitDefaultHelpFlag() // make possible 'help' flag to be shown
- cmd.Help()
- }
- },
- }
- }
- c.RemoveCommand(c.helpCommand)
- c.AddCommand(c.helpCommand)
-}
-
-// ResetCommands delete parent, subcommand and help command from c.
-func (c *Command) ResetCommands() {
- c.parent = nil
- c.commands = nil
- c.helpCommand = nil
- c.parentsPflags = nil
-}
-
-// Sorts commands by their names.
-type commandSorterByName []*Command
-
-func (c commandSorterByName) Len() int { return len(c) }
-func (c commandSorterByName) Swap(i, j int) { c[i], c[j] = c[j], c[i] }
-func (c commandSorterByName) Less(i, j int) bool { return c[i].Name() < c[j].Name() }
-
-// Commands returns a sorted slice of child commands.
-func (c *Command) Commands() []*Command {
- // do not sort commands if it already sorted or sorting was disabled
- if EnableCommandSorting && !c.commandsAreSorted {
- sort.Sort(commandSorterByName(c.commands))
- c.commandsAreSorted = true
- }
- return c.commands
-}
-
-// AddCommand adds one or more commands to this parent command.
-func (c *Command) AddCommand(cmds ...*Command) {
- for i, x := range cmds {
- if cmds[i] == c {
- panic("Command can't be a child of itself")
- }
- cmds[i].parent = c
- // update max lengths
- usageLen := len(x.Use)
- if usageLen > c.commandsMaxUseLen {
- c.commandsMaxUseLen = usageLen
- }
- commandPathLen := len(x.CommandPath())
- if commandPathLen > c.commandsMaxCommandPathLen {
- c.commandsMaxCommandPathLen = commandPathLen
- }
- nameLen := len(x.Name())
- if nameLen > c.commandsMaxNameLen {
- c.commandsMaxNameLen = nameLen
- }
- // If global normalization function exists, update all children
- if c.globNormFunc != nil {
- x.SetGlobalNormalizationFunc(c.globNormFunc)
- }
- c.commands = append(c.commands, x)
- c.commandsAreSorted = false
- }
-}
-
-// RemoveCommand removes one or more commands from a parent command.
-func (c *Command) RemoveCommand(cmds ...*Command) {
- commands := []*Command{}
-main:
- for _, command := range c.commands {
- for _, cmd := range cmds {
- if command == cmd {
- command.parent = nil
- continue main
- }
- }
- commands = append(commands, command)
- }
- c.commands = commands
- // recompute all lengths
- c.commandsMaxUseLen = 0
- c.commandsMaxCommandPathLen = 0
- c.commandsMaxNameLen = 0
- for _, command := range c.commands {
- usageLen := len(command.Use)
- if usageLen > c.commandsMaxUseLen {
- c.commandsMaxUseLen = usageLen
- }
- commandPathLen := len(command.CommandPath())
- if commandPathLen > c.commandsMaxCommandPathLen {
- c.commandsMaxCommandPathLen = commandPathLen
- }
- nameLen := len(command.Name())
- if nameLen > c.commandsMaxNameLen {
- c.commandsMaxNameLen = nameLen
- }
- }
-}
-
-// Print is a convenience method to Print to the defined output, fallback to Stderr if not set.
-func (c *Command) Print(i ...interface{}) {
- fmt.Fprint(c.OutOrStderr(), i...)
-}
-
-// Println is a convenience method to Println to the defined output, fallback to Stderr if not set.
-func (c *Command) Println(i ...interface{}) {
- c.Print(fmt.Sprintln(i...))
-}
-
-// Printf is a convenience method to Printf to the defined output, fallback to Stderr if not set.
-func (c *Command) Printf(format string, i ...interface{}) {
- c.Print(fmt.Sprintf(format, i...))
-}
-
-// CommandPath returns the full path to this command.
-func (c *Command) CommandPath() string {
- if c.HasParent() {
- return c.Parent().CommandPath() + " " + c.Name()
- }
- return c.Name()
-}
-
-// UseLine puts out the full usage for a given command (including parents).
-func (c *Command) UseLine() string {
- var useline string
- if c.HasParent() {
- useline = c.parent.CommandPath() + " " + c.Use
- } else {
- useline = c.Use
- }
- if c.DisableFlagsInUseLine {
- return useline
- }
- if c.HasAvailableFlags() && !strings.Contains(useline, "[flags]") {
- useline += " [flags]"
- }
- return useline
-}
-
-// DebugFlags used to determine which flags have been assigned to which commands
-// and which persist.
-func (c *Command) DebugFlags() {
- c.Println("DebugFlags called on", c.Name())
- var debugflags func(*Command)
-
- debugflags = func(x *Command) {
- if x.HasFlags() || x.HasPersistentFlags() {
- c.Println(x.Name())
- }
- if x.HasFlags() {
- x.flags.VisitAll(func(f *flag.Flag) {
- if x.HasPersistentFlags() && x.persistentFlag(f.Name) != nil {
- c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [LP]")
- } else {
- c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [L]")
- }
- })
- }
- if x.HasPersistentFlags() {
- x.pflags.VisitAll(func(f *flag.Flag) {
- if x.HasFlags() {
- if x.flags.Lookup(f.Name) == nil {
- c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]")
- }
- } else {
- c.Println(" -"+f.Shorthand+",", "--"+f.Name, "["+f.DefValue+"]", "", f.Value, " [P]")
- }
- })
- }
- c.Println(x.flagErrorBuf)
- if x.HasSubCommands() {
- for _, y := range x.commands {
- debugflags(y)
- }
- }
- }
-
- debugflags(c)
-}
-
-// Name returns the command's name: the first word in the use line.
-func (c *Command) Name() string {
- name := c.Use
- i := strings.Index(name, " ")
- if i >= 0 {
- name = name[:i]
- }
- return name
-}
-
-// HasAlias determines if a given string is an alias of the command.
-func (c *Command) HasAlias(s string) bool {
- for _, a := range c.Aliases {
- if a == s {
- return true
- }
- }
- return false
-}
-
-// CalledAs returns the command name or alias that was used to invoke
-// this command or an empty string if the command has not been called.
-func (c *Command) CalledAs() string {
- if c.commandCalledAs.called {
- return c.commandCalledAs.name
- }
- return ""
-}
-
-// hasNameOrAliasPrefix returns true if the Name or any of aliases start
-// with prefix
-func (c *Command) hasNameOrAliasPrefix(prefix string) bool {
- if strings.HasPrefix(c.Name(), prefix) {
- c.commandCalledAs.name = c.Name()
- return true
- }
- for _, alias := range c.Aliases {
- if strings.HasPrefix(alias, prefix) {
- c.commandCalledAs.name = alias
- return true
- }
- }
- return false
-}
-
-// NameAndAliases returns a list of the command name and all aliases
-func (c *Command) NameAndAliases() string {
- return strings.Join(append([]string{c.Name()}, c.Aliases...), ", ")
-}
-
-// HasExample determines if the command has example.
-func (c *Command) HasExample() bool {
- return len(c.Example) > 0
-}
-
-// Runnable determines if the command is itself runnable.
-func (c *Command) Runnable() bool {
- return c.Run != nil || c.RunE != nil
-}
-
-// HasSubCommands determines if the command has children commands.
-func (c *Command) HasSubCommands() bool {
- return len(c.commands) > 0
-}
-
-// IsAvailableCommand determines if a command is available as a non-help command
-// (this includes all non deprecated/hidden commands).
-func (c *Command) IsAvailableCommand() bool {
- if len(c.Deprecated) != 0 || c.Hidden {
- return false
- }
-
- if c.HasParent() && c.Parent().helpCommand == c {
- return false
- }
-
- if c.Runnable() || c.HasAvailableSubCommands() {
- return true
- }
-
- return false
-}
-
-// IsAdditionalHelpTopicCommand determines if a command is an additional
-// help topic command; additional help topic command is determined by the
-// fact that it is NOT runnable/hidden/deprecated, and has no sub commands that
-// are runnable/hidden/deprecated.
-// Concrete example: https://github.com/spf13/cobra/issues/393#issuecomment-282741924.
-func (c *Command) IsAdditionalHelpTopicCommand() bool {
- // if a command is runnable, deprecated, or hidden it is not a 'help' command
- if c.Runnable() || len(c.Deprecated) != 0 || c.Hidden {
- return false
- }
-
- // if any non-help sub commands are found, the command is not a 'help' command
- for _, sub := range c.commands {
- if !sub.IsAdditionalHelpTopicCommand() {
- return false
- }
- }
-
- // the command either has no sub commands, or no non-help sub commands
- return true
-}
-
-// HasHelpSubCommands determines if a command has any available 'help' sub commands
-// that need to be shown in the usage/help default template under 'additional help
-// topics'.
-func (c *Command) HasHelpSubCommands() bool {
- // return true on the first found available 'help' sub command
- for _, sub := range c.commands {
- if sub.IsAdditionalHelpTopicCommand() {
- return true
- }
- }
-
- // the command either has no sub commands, or no available 'help' sub commands
- return false
-}
-
-// HasAvailableSubCommands determines if a command has available sub commands that
-// need to be shown in the usage/help default template under 'available commands'.
-func (c *Command) HasAvailableSubCommands() bool {
- // return true on the first found available (non deprecated/help/hidden)
- // sub command
- for _, sub := range c.commands {
- if sub.IsAvailableCommand() {
- return true
- }
- }
-
- // the command either has no sub commands, or no available (non deprecated/help/hidden)
- // sub commands
- return false
-}
-
-// HasParent determines if the command is a child command.
-func (c *Command) HasParent() bool {
- return c.parent != nil
-}
-
-// GlobalNormalizationFunc returns the global normalization function or nil if it doesn't exist.
-func (c *Command) GlobalNormalizationFunc() func(f *flag.FlagSet, name string) flag.NormalizedName {
- return c.globNormFunc
-}
-
-// Flags returns the complete FlagSet that applies
-// to this command (local and persistent declared here and by all parents).
-func (c *Command) Flags() *flag.FlagSet {
- if c.flags == nil {
- c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- if c.flagErrorBuf == nil {
- c.flagErrorBuf = new(bytes.Buffer)
- }
- c.flags.SetOutput(c.flagErrorBuf)
- }
-
- return c.flags
-}
-
-// LocalNonPersistentFlags are flags specific to this command which will NOT persist to subcommands.
-func (c *Command) LocalNonPersistentFlags() *flag.FlagSet {
- persistentFlags := c.PersistentFlags()
-
- out := flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- c.LocalFlags().VisitAll(func(f *flag.Flag) {
- if persistentFlags.Lookup(f.Name) == nil {
- out.AddFlag(f)
- }
- })
- return out
-}
-
-// LocalFlags returns the local FlagSet specifically set in the current command.
-func (c *Command) LocalFlags() *flag.FlagSet {
- c.mergePersistentFlags()
-
- if c.lflags == nil {
- c.lflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- if c.flagErrorBuf == nil {
- c.flagErrorBuf = new(bytes.Buffer)
- }
- c.lflags.SetOutput(c.flagErrorBuf)
- }
- c.lflags.SortFlags = c.Flags().SortFlags
- if c.globNormFunc != nil {
- c.lflags.SetNormalizeFunc(c.globNormFunc)
- }
-
- addToLocal := func(f *flag.Flag) {
- if c.lflags.Lookup(f.Name) == nil && c.parentsPflags.Lookup(f.Name) == nil {
- c.lflags.AddFlag(f)
- }
- }
- c.Flags().VisitAll(addToLocal)
- c.PersistentFlags().VisitAll(addToLocal)
- return c.lflags
-}
-
-// InheritedFlags returns all flags which were inherited from parents commands.
-func (c *Command) InheritedFlags() *flag.FlagSet {
- c.mergePersistentFlags()
-
- if c.iflags == nil {
- c.iflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- if c.flagErrorBuf == nil {
- c.flagErrorBuf = new(bytes.Buffer)
- }
- c.iflags.SetOutput(c.flagErrorBuf)
- }
-
- local := c.LocalFlags()
- if c.globNormFunc != nil {
- c.iflags.SetNormalizeFunc(c.globNormFunc)
- }
-
- c.parentsPflags.VisitAll(func(f *flag.Flag) {
- if c.iflags.Lookup(f.Name) == nil && local.Lookup(f.Name) == nil {
- c.iflags.AddFlag(f)
- }
- })
- return c.iflags
-}
-
-// NonInheritedFlags returns all flags which were not inherited from parent commands.
-func (c *Command) NonInheritedFlags() *flag.FlagSet {
- return c.LocalFlags()
-}
-
-// PersistentFlags returns the persistent FlagSet specifically set in the current command.
-func (c *Command) PersistentFlags() *flag.FlagSet {
- if c.pflags == nil {
- c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- if c.flagErrorBuf == nil {
- c.flagErrorBuf = new(bytes.Buffer)
- }
- c.pflags.SetOutput(c.flagErrorBuf)
- }
- return c.pflags
-}
-
-// ResetFlags deletes all flags from command.
-func (c *Command) ResetFlags() {
- c.flagErrorBuf = new(bytes.Buffer)
- c.flagErrorBuf.Reset()
- c.flags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- c.flags.SetOutput(c.flagErrorBuf)
- c.pflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- c.pflags.SetOutput(c.flagErrorBuf)
-
- c.lflags = nil
- c.iflags = nil
- c.parentsPflags = nil
-}
-
-// HasFlags checks if the command contains any flags (local plus persistent from the entire structure).
-func (c *Command) HasFlags() bool {
- return c.Flags().HasFlags()
-}
-
-// HasPersistentFlags checks if the command contains persistent flags.
-func (c *Command) HasPersistentFlags() bool {
- return c.PersistentFlags().HasFlags()
-}
-
-// HasLocalFlags checks if the command has flags specifically declared locally.
-func (c *Command) HasLocalFlags() bool {
- return c.LocalFlags().HasFlags()
-}
-
-// HasInheritedFlags checks if the command has flags inherited from its parent command.
-func (c *Command) HasInheritedFlags() bool {
- return c.InheritedFlags().HasFlags()
-}
-
-// HasAvailableFlags checks if the command contains any flags (local plus persistent from the entire
-// structure) which are not hidden or deprecated.
-func (c *Command) HasAvailableFlags() bool {
- return c.Flags().HasAvailableFlags()
-}
-
-// HasAvailablePersistentFlags checks if the command contains persistent flags which are not hidden or deprecated.
-func (c *Command) HasAvailablePersistentFlags() bool {
- return c.PersistentFlags().HasAvailableFlags()
-}
-
-// HasAvailableLocalFlags checks if the command has flags specifically declared locally which are not hidden
-// or deprecated.
-func (c *Command) HasAvailableLocalFlags() bool {
- return c.LocalFlags().HasAvailableFlags()
-}
-
-// HasAvailableInheritedFlags checks if the command has flags inherited from its parent command which are
-// not hidden or deprecated.
-func (c *Command) HasAvailableInheritedFlags() bool {
- return c.InheritedFlags().HasAvailableFlags()
-}
-
-// Flag climbs up the command tree looking for matching flag.
-func (c *Command) Flag(name string) (flag *flag.Flag) {
- flag = c.Flags().Lookup(name)
-
- if flag == nil {
- flag = c.persistentFlag(name)
- }
-
- return
-}
-
-// Recursively find matching persistent flag.
-func (c *Command) persistentFlag(name string) (flag *flag.Flag) {
- if c.HasPersistentFlags() {
- flag = c.PersistentFlags().Lookup(name)
- }
-
- if flag == nil {
- c.updateParentsPflags()
- flag = c.parentsPflags.Lookup(name)
- }
- return
-}
-
-// ParseFlags parses persistent flag tree and local flags.
-func (c *Command) ParseFlags(args []string) error {
- if c.DisableFlagParsing {
- return nil
- }
-
- if c.flagErrorBuf == nil {
- c.flagErrorBuf = new(bytes.Buffer)
- }
- beforeErrorBufLen := c.flagErrorBuf.Len()
- c.mergePersistentFlags()
-
- //do it here after merging all flags and just before parse
- c.Flags().ParseErrorsWhitelist = flag.ParseErrorsWhitelist(c.FParseErrWhitelist)
-
- err := c.Flags().Parse(args)
- // Print warnings if they occurred (e.g. deprecated flag messages).
- if c.flagErrorBuf.Len()-beforeErrorBufLen > 0 && err == nil {
- c.Print(c.flagErrorBuf.String())
- }
-
- return err
-}
-
-// Parent returns a commands parent command.
-func (c *Command) Parent() *Command {
- return c.parent
-}
-
-// mergePersistentFlags merges c.PersistentFlags() to c.Flags()
-// and adds missing persistent flags of all parents.
-func (c *Command) mergePersistentFlags() {
- c.updateParentsPflags()
- c.Flags().AddFlagSet(c.PersistentFlags())
- c.Flags().AddFlagSet(c.parentsPflags)
-}
-
-// updateParentsPflags updates c.parentsPflags by adding
-// new persistent flags of all parents.
-// If c.parentsPflags == nil, it makes new.
-func (c *Command) updateParentsPflags() {
- if c.parentsPflags == nil {
- c.parentsPflags = flag.NewFlagSet(c.Name(), flag.ContinueOnError)
- c.parentsPflags.SetOutput(c.flagErrorBuf)
- c.parentsPflags.SortFlags = false
- }
-
- if c.globNormFunc != nil {
- c.parentsPflags.SetNormalizeFunc(c.globNormFunc)
- }
-
- c.Root().PersistentFlags().AddFlagSet(flag.CommandLine)
-
- c.VisitParents(func(parent *Command) {
- c.parentsPflags.AddFlagSet(parent.PersistentFlags())
- })
-}
diff --git a/vendor/github.com/spf13/cobra/command_notwin.go b/vendor/github.com/spf13/cobra/command_notwin.go
deleted file mode 100644
index 6159c1c..0000000
--- a/vendor/github.com/spf13/cobra/command_notwin.go
+++ /dev/null
@@ -1,5 +0,0 @@
-// +build !windows
-
-package cobra
-
-var preExecHookFn func(*Command)
diff --git a/vendor/github.com/spf13/cobra/command_win.go b/vendor/github.com/spf13/cobra/command_win.go
deleted file mode 100644
index edec728..0000000
--- a/vendor/github.com/spf13/cobra/command_win.go
+++ /dev/null
@@ -1,20 +0,0 @@
-// +build windows
-
-package cobra
-
-import (
- "os"
- "time"
-
- "github.com/inconshreveable/mousetrap"
-)
-
-var preExecHookFn = preExecHook
-
-func preExecHook(c *Command) {
- if MousetrapHelpText != "" && mousetrap.StartedByExplorer() {
- c.Print(MousetrapHelpText)
- time.Sleep(5 * time.Second)
- os.Exit(1)
- }
-}
diff --git a/vendor/github.com/spf13/cobra/zsh_completions.go b/vendor/github.com/spf13/cobra/zsh_completions.go
deleted file mode 100644
index 889c22e..0000000
--- a/vendor/github.com/spf13/cobra/zsh_completions.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package cobra
-
-import (
- "bytes"
- "fmt"
- "io"
- "os"
- "strings"
-)
-
-// GenZshCompletionFile generates zsh completion file.
-func (c *Command) GenZshCompletionFile(filename string) error {
- outFile, err := os.Create(filename)
- if err != nil {
- return err
- }
- defer outFile.Close()
-
- return c.GenZshCompletion(outFile)
-}
-
-// GenZshCompletion generates a zsh completion file and writes to the passed writer.
-func (c *Command) GenZshCompletion(w io.Writer) error {
- buf := new(bytes.Buffer)
-
- writeHeader(buf, c)
- maxDepth := maxDepth(c)
- writeLevelMapping(buf, maxDepth)
- writeLevelCases(buf, maxDepth, c)
-
- _, err := buf.WriteTo(w)
- return err
-}
-
-func writeHeader(w io.Writer, cmd *Command) {
- fmt.Fprintf(w, "#compdef %s\n\n", cmd.Name())
-}
-
-func maxDepth(c *Command) int {
- if len(c.Commands()) == 0 {
- return 0
- }
- maxDepthSub := 0
- for _, s := range c.Commands() {
- subDepth := maxDepth(s)
- if subDepth > maxDepthSub {
- maxDepthSub = subDepth
- }
- }
- return 1 + maxDepthSub
-}
-
-func writeLevelMapping(w io.Writer, numLevels int) {
- fmt.Fprintln(w, `_arguments \`)
- for i := 1; i <= numLevels; i++ {
- fmt.Fprintf(w, ` '%d: :->level%d' \`, i, i)
- fmt.Fprintln(w)
- }
- fmt.Fprintf(w, ` '%d: :%s'`, numLevels+1, "_files")
- fmt.Fprintln(w)
-}
-
-func writeLevelCases(w io.Writer, maxDepth int, root *Command) {
- fmt.Fprintln(w, "case $state in")
- defer fmt.Fprintln(w, "esac")
-
- for i := 1; i <= maxDepth; i++ {
- fmt.Fprintf(w, " level%d)\n", i)
- writeLevel(w, root, i)
- fmt.Fprintln(w, " ;;")
- }
- fmt.Fprintln(w, " *)")
- fmt.Fprintln(w, " _arguments '*: :_files'")
- fmt.Fprintln(w, " ;;")
-}
-
-func writeLevel(w io.Writer, root *Command, i int) {
- fmt.Fprintf(w, " case $words[%d] in\n", i)
- defer fmt.Fprintln(w, " esac")
-
- commands := filterByLevel(root, i)
- byParent := groupByParent(commands)
-
- for p, c := range byParent {
- names := names(c)
- fmt.Fprintf(w, " %s)\n", p)
- fmt.Fprintf(w, " _arguments '%d: :(%s)'\n", i, strings.Join(names, " "))
- fmt.Fprintln(w, " ;;")
- }
- fmt.Fprintln(w, " *)")
- fmt.Fprintln(w, " _arguments '*: :_files'")
- fmt.Fprintln(w, " ;;")
-
-}
-
-func filterByLevel(c *Command, l int) []*Command {
- cs := make([]*Command, 0)
- if l == 0 {
- cs = append(cs, c)
- return cs
- }
- for _, s := range c.Commands() {
- cs = append(cs, filterByLevel(s, l-1)...)
- }
- return cs
-}
-
-func groupByParent(commands []*Command) map[string][]*Command {
- m := make(map[string][]*Command)
- for _, c := range commands {
- parent := c.Parent()
- if parent == nil {
- continue
- }
- m[parent.Name()] = append(m[parent.Name()], c)
- }
- return m
-}
-
-func names(commands []*Command) []string {
- ns := make([]string, len(commands))
- for i, c := range commands {
- ns[i] = c.Name()
- }
- return ns
-}
diff --git a/vendor/github.com/spf13/pflag/LICENSE b/vendor/github.com/spf13/pflag/LICENSE
deleted file mode 100644
index 63ed1cf..0000000
--- a/vendor/github.com/spf13/pflag/LICENSE
+++ /dev/null
@@ -1,28 +0,0 @@
-Copyright (c) 2012 Alex Ogier. All rights reserved.
-Copyright (c) 2012 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/spf13/pflag/bool.go b/vendor/github.com/spf13/pflag/bool.go
deleted file mode 100644
index c4c5c0b..0000000
--- a/vendor/github.com/spf13/pflag/bool.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package pflag
-
-import "strconv"
-
-// optional interface to indicate boolean flags that can be
-// supplied without "=value" text
-type boolFlag interface {
- Value
- IsBoolFlag() bool
-}
-
-// -- bool Value
-type boolValue bool
-
-func newBoolValue(val bool, p *bool) *boolValue {
- *p = val
- return (*boolValue)(p)
-}
-
-func (b *boolValue) Set(s string) error {
- v, err := strconv.ParseBool(s)
- *b = boolValue(v)
- return err
-}
-
-func (b *boolValue) Type() string {
- return "bool"
-}
-
-func (b *boolValue) String() string { return strconv.FormatBool(bool(*b)) }
-
-func (b *boolValue) IsBoolFlag() bool { return true }
-
-func boolConv(sval string) (interface{}, error) {
- return strconv.ParseBool(sval)
-}
-
-// GetBool return the bool value of a flag with the given name
-func (f *FlagSet) GetBool(name string) (bool, error) {
- val, err := f.getFlagType(name, "bool", boolConv)
- if err != nil {
- return false, err
- }
- return val.(bool), nil
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func (f *FlagSet) BoolVar(p *bool, name string, value bool, usage string) {
- f.BoolVarP(p, name, "", value, usage)
-}
-
-// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
- flag := f.VarPF(newBoolValue(value, p), name, shorthand, usage)
- flag.NoOptDefVal = "true"
-}
-
-// BoolVar defines a bool flag with specified name, default value, and usage string.
-// The argument p points to a bool variable in which to store the value of the flag.
-func BoolVar(p *bool, name string, value bool, usage string) {
- BoolVarP(p, name, "", value, usage)
-}
-
-// BoolVarP is like BoolVar, but accepts a shorthand letter that can be used after a single dash.
-func BoolVarP(p *bool, name, shorthand string, value bool, usage string) {
- flag := CommandLine.VarPF(newBoolValue(value, p), name, shorthand, usage)
- flag.NoOptDefVal = "true"
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func (f *FlagSet) Bool(name string, value bool, usage string) *bool {
- return f.BoolP(name, "", value, usage)
-}
-
-// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolP(name, shorthand string, value bool, usage string) *bool {
- p := new(bool)
- f.BoolVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Bool defines a bool flag with specified name, default value, and usage string.
-// The return value is the address of a bool variable that stores the value of the flag.
-func Bool(name string, value bool, usage string) *bool {
- return BoolP(name, "", value, usage)
-}
-
-// BoolP is like Bool, but accepts a shorthand letter that can be used after a single dash.
-func BoolP(name, shorthand string, value bool, usage string) *bool {
- b := CommandLine.BoolP(name, shorthand, value, usage)
- return b
-}
diff --git a/vendor/github.com/spf13/pflag/bool_slice.go b/vendor/github.com/spf13/pflag/bool_slice.go
deleted file mode 100644
index 5af02f1..0000000
--- a/vendor/github.com/spf13/pflag/bool_slice.go
+++ /dev/null
@@ -1,147 +0,0 @@
-package pflag
-
-import (
- "io"
- "strconv"
- "strings"
-)
-
-// -- boolSlice Value
-type boolSliceValue struct {
- value *[]bool
- changed bool
-}
-
-func newBoolSliceValue(val []bool, p *[]bool) *boolSliceValue {
- bsv := new(boolSliceValue)
- bsv.value = p
- *bsv.value = val
- return bsv
-}
-
-// Set converts, and assigns, the comma-separated boolean argument string representation as the []bool value of this flag.
-// If Set is called on a flag that already has a []bool assigned, the newly converted values will be appended.
-func (s *boolSliceValue) Set(val string) error {
-
- // remove all quote characters
- rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
-
- // read flag arguments with CSV parser
- boolStrSlice, err := readAsCSV(rmQuote.Replace(val))
- if err != nil && err != io.EOF {
- return err
- }
-
- // parse boolean values into slice
- out := make([]bool, 0, len(boolStrSlice))
- for _, boolStr := range boolStrSlice {
- b, err := strconv.ParseBool(strings.TrimSpace(boolStr))
- if err != nil {
- return err
- }
- out = append(out, b)
- }
-
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
-
- s.changed = true
-
- return nil
-}
-
-// Type returns a string that uniquely represents this flag's type.
-func (s *boolSliceValue) Type() string {
- return "boolSlice"
-}
-
-// String defines a "native" format for this boolean slice flag value.
-func (s *boolSliceValue) String() string {
-
- boolStrSlice := make([]string, len(*s.value))
- for i, b := range *s.value {
- boolStrSlice[i] = strconv.FormatBool(b)
- }
-
- out, _ := writeAsCSV(boolStrSlice)
-
- return "[" + out + "]"
-}
-
-func boolSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []bool{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]bool, len(ss))
- for i, t := range ss {
- var err error
- out[i], err = strconv.ParseBool(t)
- if err != nil {
- return nil, err
- }
- }
- return out, nil
-}
-
-// GetBoolSlice returns the []bool value of a flag with the given name.
-func (f *FlagSet) GetBoolSlice(name string) ([]bool, error) {
- val, err := f.getFlagType(name, "boolSlice", boolSliceConv)
- if err != nil {
- return []bool{}, err
- }
- return val.([]bool), nil
-}
-
-// BoolSliceVar defines a boolSlice flag with specified name, default value, and usage string.
-// The argument p points to a []bool variable in which to store the value of the flag.
-func (f *FlagSet) BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
- f.VarP(newBoolSliceValue(value, p), name, "", usage)
-}
-
-// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
- f.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
-}
-
-// BoolSliceVar defines a []bool flag with specified name, default value, and usage string.
-// The argument p points to a []bool variable in which to store the value of the flag.
-func BoolSliceVar(p *[]bool, name string, value []bool, usage string) {
- CommandLine.VarP(newBoolSliceValue(value, p), name, "", usage)
-}
-
-// BoolSliceVarP is like BoolSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func BoolSliceVarP(p *[]bool, name, shorthand string, value []bool, usage string) {
- CommandLine.VarP(newBoolSliceValue(value, p), name, shorthand, usage)
-}
-
-// BoolSlice defines a []bool flag with specified name, default value, and usage string.
-// The return value is the address of a []bool variable that stores the value of the flag.
-func (f *FlagSet) BoolSlice(name string, value []bool, usage string) *[]bool {
- p := []bool{}
- f.BoolSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
- p := []bool{}
- f.BoolSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// BoolSlice defines a []bool flag with specified name, default value, and usage string.
-// The return value is the address of a []bool variable that stores the value of the flag.
-func BoolSlice(name string, value []bool, usage string) *[]bool {
- return CommandLine.BoolSliceP(name, "", value, usage)
-}
-
-// BoolSliceP is like BoolSlice, but accepts a shorthand letter that can be used after a single dash.
-func BoolSliceP(name, shorthand string, value []bool, usage string) *[]bool {
- return CommandLine.BoolSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/bytes.go b/vendor/github.com/spf13/pflag/bytes.go
deleted file mode 100644
index 67d5304..0000000
--- a/vendor/github.com/spf13/pflag/bytes.go
+++ /dev/null
@@ -1,209 +0,0 @@
-package pflag
-
-import (
- "encoding/base64"
- "encoding/hex"
- "fmt"
- "strings"
-)
-
-// BytesHex adapts []byte for use as a flag. Value of flag is HEX encoded
-type bytesHexValue []byte
-
-// String implements pflag.Value.String.
-func (bytesHex bytesHexValue) String() string {
- return fmt.Sprintf("%X", []byte(bytesHex))
-}
-
-// Set implements pflag.Value.Set.
-func (bytesHex *bytesHexValue) Set(value string) error {
- bin, err := hex.DecodeString(strings.TrimSpace(value))
-
- if err != nil {
- return err
- }
-
- *bytesHex = bin
-
- return nil
-}
-
-// Type implements pflag.Value.Type.
-func (*bytesHexValue) Type() string {
- return "bytesHex"
-}
-
-func newBytesHexValue(val []byte, p *[]byte) *bytesHexValue {
- *p = val
- return (*bytesHexValue)(p)
-}
-
-func bytesHexConv(sval string) (interface{}, error) {
-
- bin, err := hex.DecodeString(sval)
-
- if err == nil {
- return bin, nil
- }
-
- return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err)
-}
-
-// GetBytesHex return the []byte value of a flag with the given name
-func (f *FlagSet) GetBytesHex(name string) ([]byte, error) {
- val, err := f.getFlagType(name, "bytesHex", bytesHexConv)
-
- if err != nil {
- return []byte{}, err
- }
-
- return val.([]byte), nil
-}
-
-// BytesHexVar defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func (f *FlagSet) BytesHexVar(p *[]byte, name string, value []byte, usage string) {
- f.VarP(newBytesHexValue(value, p), name, "", usage)
-}
-
-// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- f.VarP(newBytesHexValue(value, p), name, shorthand, usage)
-}
-
-// BytesHexVar defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func BytesHexVar(p *[]byte, name string, value []byte, usage string) {
- CommandLine.VarP(newBytesHexValue(value, p), name, "", usage)
-}
-
-// BytesHexVarP is like BytesHexVar, but accepts a shorthand letter that can be used after a single dash.
-func BytesHexVarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- CommandLine.VarP(newBytesHexValue(value, p), name, shorthand, usage)
-}
-
-// BytesHex defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func (f *FlagSet) BytesHex(name string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesHexVarP(p, name, "", value, usage)
- return p
-}
-
-// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesHexP(name, shorthand string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesHexVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// BytesHex defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func BytesHex(name string, value []byte, usage string) *[]byte {
- return CommandLine.BytesHexP(name, "", value, usage)
-}
-
-// BytesHexP is like BytesHex, but accepts a shorthand letter that can be used after a single dash.
-func BytesHexP(name, shorthand string, value []byte, usage string) *[]byte {
- return CommandLine.BytesHexP(name, shorthand, value, usage)
-}
-
-// BytesBase64 adapts []byte for use as a flag. Value of flag is Base64 encoded
-type bytesBase64Value []byte
-
-// String implements pflag.Value.String.
-func (bytesBase64 bytesBase64Value) String() string {
- return base64.StdEncoding.EncodeToString([]byte(bytesBase64))
-}
-
-// Set implements pflag.Value.Set.
-func (bytesBase64 *bytesBase64Value) Set(value string) error {
- bin, err := base64.StdEncoding.DecodeString(strings.TrimSpace(value))
-
- if err != nil {
- return err
- }
-
- *bytesBase64 = bin
-
- return nil
-}
-
-// Type implements pflag.Value.Type.
-func (*bytesBase64Value) Type() string {
- return "bytesBase64"
-}
-
-func newBytesBase64Value(val []byte, p *[]byte) *bytesBase64Value {
- *p = val
- return (*bytesBase64Value)(p)
-}
-
-func bytesBase64ValueConv(sval string) (interface{}, error) {
-
- bin, err := base64.StdEncoding.DecodeString(sval)
- if err == nil {
- return bin, nil
- }
-
- return nil, fmt.Errorf("invalid string being converted to Bytes: %s %s", sval, err)
-}
-
-// GetBytesBase64 return the []byte value of a flag with the given name
-func (f *FlagSet) GetBytesBase64(name string) ([]byte, error) {
- val, err := f.getFlagType(name, "bytesBase64", bytesBase64ValueConv)
-
- if err != nil {
- return []byte{}, err
- }
-
- return val.([]byte), nil
-}
-
-// BytesBase64Var defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func (f *FlagSet) BytesBase64Var(p *[]byte, name string, value []byte, usage string) {
- f.VarP(newBytesBase64Value(value, p), name, "", usage)
-}
-
-// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- f.VarP(newBytesBase64Value(value, p), name, shorthand, usage)
-}
-
-// BytesBase64Var defines an []byte flag with specified name, default value, and usage string.
-// The argument p points to an []byte variable in which to store the value of the flag.
-func BytesBase64Var(p *[]byte, name string, value []byte, usage string) {
- CommandLine.VarP(newBytesBase64Value(value, p), name, "", usage)
-}
-
-// BytesBase64VarP is like BytesBase64Var, but accepts a shorthand letter that can be used after a single dash.
-func BytesBase64VarP(p *[]byte, name, shorthand string, value []byte, usage string) {
- CommandLine.VarP(newBytesBase64Value(value, p), name, shorthand, usage)
-}
-
-// BytesBase64 defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func (f *FlagSet) BytesBase64(name string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesBase64VarP(p, name, "", value, usage)
- return p
-}
-
-// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte {
- p := new([]byte)
- f.BytesBase64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// BytesBase64 defines an []byte flag with specified name, default value, and usage string.
-// The return value is the address of an []byte variable that stores the value of the flag.
-func BytesBase64(name string, value []byte, usage string) *[]byte {
- return CommandLine.BytesBase64P(name, "", value, usage)
-}
-
-// BytesBase64P is like BytesBase64, but accepts a shorthand letter that can be used after a single dash.
-func BytesBase64P(name, shorthand string, value []byte, usage string) *[]byte {
- return CommandLine.BytesBase64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/count.go b/vendor/github.com/spf13/pflag/count.go
deleted file mode 100644
index aa126e4..0000000
--- a/vendor/github.com/spf13/pflag/count.go
+++ /dev/null
@@ -1,96 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- count Value
-type countValue int
-
-func newCountValue(val int, p *int) *countValue {
- *p = val
- return (*countValue)(p)
-}
-
-func (i *countValue) Set(s string) error {
- // "+1" means that no specific value was passed, so increment
- if s == "+1" {
- *i = countValue(*i + 1)
- return nil
- }
- v, err := strconv.ParseInt(s, 0, 0)
- *i = countValue(v)
- return err
-}
-
-func (i *countValue) Type() string {
- return "count"
-}
-
-func (i *countValue) String() string { return strconv.Itoa(int(*i)) }
-
-func countConv(sval string) (interface{}, error) {
- i, err := strconv.Atoi(sval)
- if err != nil {
- return nil, err
- }
- return i, nil
-}
-
-// GetCount return the int value of a flag with the given name
-func (f *FlagSet) GetCount(name string) (int, error) {
- val, err := f.getFlagType(name, "count", countConv)
- if err != nil {
- return 0, err
- }
- return val.(int), nil
-}
-
-// CountVar defines a count flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
-func (f *FlagSet) CountVar(p *int, name string, usage string) {
- f.CountVarP(p, name, "", usage)
-}
-
-// CountVarP is like CountVar only take a shorthand for the flag name.
-func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) {
- flag := f.VarPF(newCountValue(0, p), name, shorthand, usage)
- flag.NoOptDefVal = "+1"
-}
-
-// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set
-func CountVar(p *int, name string, usage string) {
- CommandLine.CountVar(p, name, usage)
-}
-
-// CountVarP is like CountVar only take a shorthand for the flag name.
-func CountVarP(p *int, name, shorthand string, usage string) {
- CommandLine.CountVarP(p, name, shorthand, usage)
-}
-
-// Count defines a count flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
-func (f *FlagSet) Count(name string, usage string) *int {
- p := new(int)
- f.CountVarP(p, name, "", usage)
- return p
-}
-
-// CountP is like Count only takes a shorthand for the flag name.
-func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
- p := new(int)
- f.CountVarP(p, name, shorthand, usage)
- return p
-}
-
-// Count defines a count flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-// A count flag will add 1 to its value evey time it is found on the command line
-func Count(name string, usage string) *int {
- return CommandLine.CountP(name, "", usage)
-}
-
-// CountP is like Count only takes a shorthand for the flag name.
-func CountP(name, shorthand string, usage string) *int {
- return CommandLine.CountP(name, shorthand, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/duration.go b/vendor/github.com/spf13/pflag/duration.go
deleted file mode 100644
index e9debef..0000000
--- a/vendor/github.com/spf13/pflag/duration.go
+++ /dev/null
@@ -1,86 +0,0 @@
-package pflag
-
-import (
- "time"
-)
-
-// -- time.Duration Value
-type durationValue time.Duration
-
-func newDurationValue(val time.Duration, p *time.Duration) *durationValue {
- *p = val
- return (*durationValue)(p)
-}
-
-func (d *durationValue) Set(s string) error {
- v, err := time.ParseDuration(s)
- *d = durationValue(v)
- return err
-}
-
-func (d *durationValue) Type() string {
- return "duration"
-}
-
-func (d *durationValue) String() string { return (*time.Duration)(d).String() }
-
-func durationConv(sval string) (interface{}, error) {
- return time.ParseDuration(sval)
-}
-
-// GetDuration return the duration value of a flag with the given name
-func (f *FlagSet) GetDuration(name string) (time.Duration, error) {
- val, err := f.getFlagType(name, "duration", durationConv)
- if err != nil {
- return 0, err
- }
- return val.(time.Duration), nil
-}
-
-// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
-// The argument p points to a time.Duration variable in which to store the value of the flag.
-func (f *FlagSet) DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
- f.VarP(newDurationValue(value, p), name, "", usage)
-}
-
-// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
- f.VarP(newDurationValue(value, p), name, shorthand, usage)
-}
-
-// DurationVar defines a time.Duration flag with specified name, default value, and usage string.
-// The argument p points to a time.Duration variable in which to store the value of the flag.
-func DurationVar(p *time.Duration, name string, value time.Duration, usage string) {
- CommandLine.VarP(newDurationValue(value, p), name, "", usage)
-}
-
-// DurationVarP is like DurationVar, but accepts a shorthand letter that can be used after a single dash.
-func DurationVarP(p *time.Duration, name, shorthand string, value time.Duration, usage string) {
- CommandLine.VarP(newDurationValue(value, p), name, shorthand, usage)
-}
-
-// Duration defines a time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a time.Duration variable that stores the value of the flag.
-func (f *FlagSet) Duration(name string, value time.Duration, usage string) *time.Duration {
- p := new(time.Duration)
- f.DurationVarP(p, name, "", value, usage)
- return p
-}
-
-// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
- p := new(time.Duration)
- f.DurationVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Duration defines a time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a time.Duration variable that stores the value of the flag.
-func Duration(name string, value time.Duration, usage string) *time.Duration {
- return CommandLine.DurationP(name, "", value, usage)
-}
-
-// DurationP is like Duration, but accepts a shorthand letter that can be used after a single dash.
-func DurationP(name, shorthand string, value time.Duration, usage string) *time.Duration {
- return CommandLine.DurationP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/duration_slice.go b/vendor/github.com/spf13/pflag/duration_slice.go
deleted file mode 100644
index 52c6b6d..0000000
--- a/vendor/github.com/spf13/pflag/duration_slice.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strings"
- "time"
-)
-
-// -- durationSlice Value
-type durationSliceValue struct {
- value *[]time.Duration
- changed bool
-}
-
-func newDurationSliceValue(val []time.Duration, p *[]time.Duration) *durationSliceValue {
- dsv := new(durationSliceValue)
- dsv.value = p
- *dsv.value = val
- return dsv
-}
-
-func (s *durationSliceValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make([]time.Duration, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = time.ParseDuration(d)
- if err != nil {
- return err
- }
-
- }
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
- s.changed = true
- return nil
-}
-
-func (s *durationSliceValue) Type() string {
- return "durationSlice"
-}
-
-func (s *durationSliceValue) String() string {
- out := make([]string, len(*s.value))
- for i, d := range *s.value {
- out[i] = fmt.Sprintf("%s", d)
- }
- return "[" + strings.Join(out, ",") + "]"
-}
-
-func durationSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []time.Duration{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]time.Duration, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = time.ParseDuration(d)
- if err != nil {
- return nil, err
- }
-
- }
- return out, nil
-}
-
-// GetDurationSlice returns the []time.Duration value of a flag with the given name
-func (f *FlagSet) GetDurationSlice(name string) ([]time.Duration, error) {
- val, err := f.getFlagType(name, "durationSlice", durationSliceConv)
- if err != nil {
- return []time.Duration{}, err
- }
- return val.([]time.Duration), nil
-}
-
-// DurationSliceVar defines a durationSlice flag with specified name, default value, and usage string.
-// The argument p points to a []time.Duration variable in which to store the value of the flag.
-func (f *FlagSet) DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) {
- f.VarP(newDurationSliceValue(value, p), name, "", usage)
-}
-
-// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) {
- f.VarP(newDurationSliceValue(value, p), name, shorthand, usage)
-}
-
-// DurationSliceVar defines a duration[] flag with specified name, default value, and usage string.
-// The argument p points to a duration[] variable in which to store the value of the flag.
-func DurationSliceVar(p *[]time.Duration, name string, value []time.Duration, usage string) {
- CommandLine.VarP(newDurationSliceValue(value, p), name, "", usage)
-}
-
-// DurationSliceVarP is like DurationSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func DurationSliceVarP(p *[]time.Duration, name, shorthand string, value []time.Duration, usage string) {
- CommandLine.VarP(newDurationSliceValue(value, p), name, shorthand, usage)
-}
-
-// DurationSlice defines a []time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a []time.Duration variable that stores the value of the flag.
-func (f *FlagSet) DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration {
- p := []time.Duration{}
- f.DurationSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration {
- p := []time.Duration{}
- f.DurationSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// DurationSlice defines a []time.Duration flag with specified name, default value, and usage string.
-// The return value is the address of a []time.Duration variable that stores the value of the flag.
-func DurationSlice(name string, value []time.Duration, usage string) *[]time.Duration {
- return CommandLine.DurationSliceP(name, "", value, usage)
-}
-
-// DurationSliceP is like DurationSlice, but accepts a shorthand letter that can be used after a single dash.
-func DurationSliceP(name, shorthand string, value []time.Duration, usage string) *[]time.Duration {
- return CommandLine.DurationSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/flag.go b/vendor/github.com/spf13/pflag/flag.go
deleted file mode 100644
index 9beeda8..0000000
--- a/vendor/github.com/spf13/pflag/flag.go
+++ /dev/null
@@ -1,1227 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-/*
-Package pflag is a drop-in replacement for Go's flag package, implementing
-POSIX/GNU-style --flags.
-
-pflag is compatible with the GNU extensions to the POSIX recommendations
-for command-line options. See
-http://www.gnu.org/software/libc/manual/html_node/Argument-Syntax.html
-
-Usage:
-
-pflag is a drop-in replacement of Go's native flag package. If you import
-pflag under the name "flag" then all code should continue to function
-with no changes.
-
- import flag "github.com/spf13/pflag"
-
-There is one exception to this: if you directly instantiate the Flag struct
-there is one more field "Shorthand" that you will need to set.
-Most code never instantiates this struct directly, and instead uses
-functions such as String(), BoolVar(), and Var(), and is therefore
-unaffected.
-
-Define flags using flag.String(), Bool(), Int(), etc.
-
-This declares an integer flag, -flagname, stored in the pointer ip, with type *int.
- var ip = flag.Int("flagname", 1234, "help message for flagname")
-If you like, you can bind the flag to a variable using the Var() functions.
- var flagvar int
- func init() {
- flag.IntVar(&flagvar, "flagname", 1234, "help message for flagname")
- }
-Or you can create custom flags that satisfy the Value interface (with
-pointer receivers) and couple them to flag parsing by
- flag.Var(&flagVal, "name", "help message for flagname")
-For such flags, the default value is just the initial value of the variable.
-
-After all flags are defined, call
- flag.Parse()
-to parse the command line into the defined flags.
-
-Flags may then be used directly. If you're using the flags themselves,
-they are all pointers; if you bind to variables, they're values.
- fmt.Println("ip has value ", *ip)
- fmt.Println("flagvar has value ", flagvar)
-
-After parsing, the arguments after the flag are available as the
-slice flag.Args() or individually as flag.Arg(i).
-The arguments are indexed from 0 through flag.NArg()-1.
-
-The pflag package also defines some new functions that are not in flag,
-that give one-letter shorthands for flags. You can use these by appending
-'P' to the name of any function that defines a flag.
- var ip = flag.IntP("flagname", "f", 1234, "help message")
- var flagvar bool
- func init() {
- flag.BoolVarP("boolname", "b", true, "help message")
- }
- flag.VarP(&flagVar, "varname", "v", 1234, "help message")
-Shorthand letters can be used with single dashes on the command line.
-Boolean shorthand flags can be combined with other shorthand flags.
-
-Command line flag syntax:
- --flag // boolean flags only
- --flag=x
-
-Unlike the flag package, a single dash before an option means something
-different than a double dash. Single dashes signify a series of shorthand
-letters for flags. All but the last shorthand letter must be boolean flags.
- // boolean flags
- -f
- -abc
- // non-boolean flags
- -n 1234
- -Ifile
- // mixed
- -abcs "hello"
- -abcn1234
-
-Flag parsing stops after the terminator "--". Unlike the flag package,
-flags can be interspersed with arguments anywhere on the command line
-before this terminator.
-
-Integer flags accept 1234, 0664, 0x1234 and may be negative.
-Boolean flags (in their long form) accept 1, 0, t, f, true, false,
-TRUE, FALSE, True, False.
-Duration flags accept any input valid for time.ParseDuration.
-
-The default set of command-line flags is controlled by
-top-level functions. The FlagSet type allows one to define
-independent sets of flags, such as to implement subcommands
-in a command-line interface. The methods of FlagSet are
-analogous to the top-level functions for the command-line
-flag set.
-*/
-package pflag
-
-import (
- "bytes"
- "errors"
- goflag "flag"
- "fmt"
- "io"
- "os"
- "sort"
- "strings"
-)
-
-// ErrHelp is the error returned if the flag -help is invoked but no such flag is defined.
-var ErrHelp = errors.New("pflag: help requested")
-
-// ErrorHandling defines how to handle flag parsing errors.
-type ErrorHandling int
-
-const (
- // ContinueOnError will return an err from Parse() if an error is found
- ContinueOnError ErrorHandling = iota
- // ExitOnError will call os.Exit(2) if an error is found when parsing
- ExitOnError
- // PanicOnError will panic() if an error is found when parsing flags
- PanicOnError
-)
-
-// ParseErrorsWhitelist defines the parsing errors that can be ignored
-type ParseErrorsWhitelist struct {
- // UnknownFlags will ignore unknown flags errors and continue parsing rest of the flags
- UnknownFlags bool
-}
-
-// NormalizedName is a flag name that has been normalized according to rules
-// for the FlagSet (e.g. making '-' and '_' equivalent).
-type NormalizedName string
-
-// A FlagSet represents a set of defined flags.
-type FlagSet struct {
- // Usage is the function called when an error occurs while parsing flags.
- // The field is a function (not a method) that may be changed to point to
- // a custom error handler.
- Usage func()
-
- // SortFlags is used to indicate, if user wants to have sorted flags in
- // help/usage messages.
- SortFlags bool
-
- // ParseErrorsWhitelist is used to configure a whitelist of errors
- ParseErrorsWhitelist ParseErrorsWhitelist
-
- name string
- parsed bool
- actual map[NormalizedName]*Flag
- orderedActual []*Flag
- sortedActual []*Flag
- formal map[NormalizedName]*Flag
- orderedFormal []*Flag
- sortedFormal []*Flag
- shorthands map[byte]*Flag
- args []string // arguments after flags
- argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no --
- errorHandling ErrorHandling
- output io.Writer // nil means stderr; use out() accessor
- interspersed bool // allow interspersed option/non-option args
- normalizeNameFunc func(f *FlagSet, name string) NormalizedName
-
- addedGoFlagSets []*goflag.FlagSet
-}
-
-// A Flag represents the state of a flag.
-type Flag struct {
- Name string // name as it appears on command line
- Shorthand string // one-letter abbreviated flag
- Usage string // help message
- Value Value // value as set
- DefValue string // default value (as text); for usage message
- Changed bool // If the user set the value (or if left to default)
- NoOptDefVal string // default value (as text); if the flag is on the command line without any options
- Deprecated string // If this flag is deprecated, this string is the new or now thing to use
- Hidden bool // used by cobra.Command to allow flags to be hidden from help/usage text
- ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use
- Annotations map[string][]string // used by cobra.Command bash autocomple code
-}
-
-// Value is the interface to the dynamic value stored in a flag.
-// (The default value is represented as a string.)
-type Value interface {
- String() string
- Set(string) error
- Type() string
-}
-
-// sortFlags returns the flags as a slice in lexicographical sorted order.
-func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
- list := make(sort.StringSlice, len(flags))
- i := 0
- for k := range flags {
- list[i] = string(k)
- i++
- }
- list.Sort()
- result := make([]*Flag, len(list))
- for i, name := range list {
- result[i] = flags[NormalizedName(name)]
- }
- return result
-}
-
-// SetNormalizeFunc allows you to add a function which can translate flag names.
-// Flags added to the FlagSet will be translated and then when anything tries to
-// look up the flag that will also be translated. So it would be possible to create
-// a flag named "getURL" and have it translated to "geturl". A user could then pass
-// "--getUrl" which may also be translated to "geturl" and everything will work.
-func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {
- f.normalizeNameFunc = n
- f.sortedFormal = f.sortedFormal[:0]
- for fname, flag := range f.formal {
- nname := f.normalizeFlagName(flag.Name)
- if fname == nname {
- continue
- }
- flag.Name = string(nname)
- delete(f.formal, fname)
- f.formal[nname] = flag
- if _, set := f.actual[fname]; set {
- delete(f.actual, fname)
- f.actual[nname] = flag
- }
- }
-}
-
-// GetNormalizeFunc returns the previously set NormalizeFunc of a function which
-// does no translation, if not set previously.
-func (f *FlagSet) GetNormalizeFunc() func(f *FlagSet, name string) NormalizedName {
- if f.normalizeNameFunc != nil {
- return f.normalizeNameFunc
- }
- return func(f *FlagSet, name string) NormalizedName { return NormalizedName(name) }
-}
-
-func (f *FlagSet) normalizeFlagName(name string) NormalizedName {
- n := f.GetNormalizeFunc()
- return n(f, name)
-}
-
-func (f *FlagSet) out() io.Writer {
- if f.output == nil {
- return os.Stderr
- }
- return f.output
-}
-
-// SetOutput sets the destination for usage and error messages.
-// If output is nil, os.Stderr is used.
-func (f *FlagSet) SetOutput(output io.Writer) {
- f.output = output
-}
-
-// VisitAll visits the flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits all flags, even those not set.
-func (f *FlagSet) VisitAll(fn func(*Flag)) {
- if len(f.formal) == 0 {
- return
- }
-
- var flags []*Flag
- if f.SortFlags {
- if len(f.formal) != len(f.sortedFormal) {
- f.sortedFormal = sortFlags(f.formal)
- }
- flags = f.sortedFormal
- } else {
- flags = f.orderedFormal
- }
-
- for _, flag := range flags {
- fn(flag)
- }
-}
-
-// HasFlags returns a bool to indicate if the FlagSet has any flags defined.
-func (f *FlagSet) HasFlags() bool {
- return len(f.formal) > 0
-}
-
-// HasAvailableFlags returns a bool to indicate if the FlagSet has any flags
-// that are not hidden.
-func (f *FlagSet) HasAvailableFlags() bool {
- for _, flag := range f.formal {
- if !flag.Hidden {
- return true
- }
- }
- return false
-}
-
-// VisitAll visits the command-line flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits all flags, even those not set.
-func VisitAll(fn func(*Flag)) {
- CommandLine.VisitAll(fn)
-}
-
-// Visit visits the flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits only those flags that have been set.
-func (f *FlagSet) Visit(fn func(*Flag)) {
- if len(f.actual) == 0 {
- return
- }
-
- var flags []*Flag
- if f.SortFlags {
- if len(f.actual) != len(f.sortedActual) {
- f.sortedActual = sortFlags(f.actual)
- }
- flags = f.sortedActual
- } else {
- flags = f.orderedActual
- }
-
- for _, flag := range flags {
- fn(flag)
- }
-}
-
-// Visit visits the command-line flags in lexicographical order or
-// in primordial order if f.SortFlags is false, calling fn for each.
-// It visits only those flags that have been set.
-func Visit(fn func(*Flag)) {
- CommandLine.Visit(fn)
-}
-
-// Lookup returns the Flag structure of the named flag, returning nil if none exists.
-func (f *FlagSet) Lookup(name string) *Flag {
- return f.lookup(f.normalizeFlagName(name))
-}
-
-// ShorthandLookup returns the Flag structure of the short handed flag,
-// returning nil if none exists.
-// It panics, if len(name) > 1.
-func (f *FlagSet) ShorthandLookup(name string) *Flag {
- if name == "" {
- return nil
- }
- if len(name) > 1 {
- msg := fmt.Sprintf("can not look up shorthand which is more than one ASCII character: %q", name)
- fmt.Fprintf(f.out(), msg)
- panic(msg)
- }
- c := name[0]
- return f.shorthands[c]
-}
-
-// lookup returns the Flag structure of the named flag, returning nil if none exists.
-func (f *FlagSet) lookup(name NormalizedName) *Flag {
- return f.formal[name]
-}
-
-// func to return a given type for a given flag name
-func (f *FlagSet) getFlagType(name string, ftype string, convFunc func(sval string) (interface{}, error)) (interface{}, error) {
- flag := f.Lookup(name)
- if flag == nil {
- err := fmt.Errorf("flag accessed but not defined: %s", name)
- return nil, err
- }
-
- if flag.Value.Type() != ftype {
- err := fmt.Errorf("trying to get %s value of flag of type %s", ftype, flag.Value.Type())
- return nil, err
- }
-
- sval := flag.Value.String()
- result, err := convFunc(sval)
- if err != nil {
- return nil, err
- }
- return result, nil
-}
-
-// ArgsLenAtDash will return the length of f.Args at the moment when a -- was
-// found during arg parsing. This allows your program to know which args were
-// before the -- and which came after.
-func (f *FlagSet) ArgsLenAtDash() int {
- return f.argsLenAtDash
-}
-
-// MarkDeprecated indicated that a flag is deprecated in your program. It will
-// continue to function but will not show up in help or usage messages. Using
-// this flag will also print the given usageMessage.
-func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {
- flag := f.Lookup(name)
- if flag == nil {
- return fmt.Errorf("flag %q does not exist", name)
- }
- if usageMessage == "" {
- return fmt.Errorf("deprecated message for flag %q must be set", name)
- }
- flag.Deprecated = usageMessage
- flag.Hidden = true
- return nil
-}
-
-// MarkShorthandDeprecated will mark the shorthand of a flag deprecated in your
-// program. It will continue to function but will not show up in help or usage
-// messages. Using this flag will also print the given usageMessage.
-func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) error {
- flag := f.Lookup(name)
- if flag == nil {
- return fmt.Errorf("flag %q does not exist", name)
- }
- if usageMessage == "" {
- return fmt.Errorf("deprecated message for flag %q must be set", name)
- }
- flag.ShorthandDeprecated = usageMessage
- return nil
-}
-
-// MarkHidden sets a flag to 'hidden' in your program. It will continue to
-// function but will not show up in help or usage messages.
-func (f *FlagSet) MarkHidden(name string) error {
- flag := f.Lookup(name)
- if flag == nil {
- return fmt.Errorf("flag %q does not exist", name)
- }
- flag.Hidden = true
- return nil
-}
-
-// Lookup returns the Flag structure of the named command-line flag,
-// returning nil if none exists.
-func Lookup(name string) *Flag {
- return CommandLine.Lookup(name)
-}
-
-// ShorthandLookup returns the Flag structure of the short handed flag,
-// returning nil if none exists.
-func ShorthandLookup(name string) *Flag {
- return CommandLine.ShorthandLookup(name)
-}
-
-// Set sets the value of the named flag.
-func (f *FlagSet) Set(name, value string) error {
- normalName := f.normalizeFlagName(name)
- flag, ok := f.formal[normalName]
- if !ok {
- return fmt.Errorf("no such flag -%v", name)
- }
-
- err := flag.Value.Set(value)
- if err != nil {
- var flagName string
- if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
- flagName = fmt.Sprintf("-%s, --%s", flag.Shorthand, flag.Name)
- } else {
- flagName = fmt.Sprintf("--%s", flag.Name)
- }
- return fmt.Errorf("invalid argument %q for %q flag: %v", value, flagName, err)
- }
-
- if !flag.Changed {
- if f.actual == nil {
- f.actual = make(map[NormalizedName]*Flag)
- }
- f.actual[normalName] = flag
- f.orderedActual = append(f.orderedActual, flag)
-
- flag.Changed = true
- }
-
- if flag.Deprecated != "" {
- fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
- }
- return nil
-}
-
-// SetAnnotation allows one to set arbitrary annotations on a flag in the FlagSet.
-// This is sometimes used by spf13/cobra programs which want to generate additional
-// bash completion information.
-func (f *FlagSet) SetAnnotation(name, key string, values []string) error {
- normalName := f.normalizeFlagName(name)
- flag, ok := f.formal[normalName]
- if !ok {
- return fmt.Errorf("no such flag -%v", name)
- }
- if flag.Annotations == nil {
- flag.Annotations = map[string][]string{}
- }
- flag.Annotations[key] = values
- return nil
-}
-
-// Changed returns true if the flag was explicitly set during Parse() and false
-// otherwise
-func (f *FlagSet) Changed(name string) bool {
- flag := f.Lookup(name)
- // If a flag doesn't exist, it wasn't changed....
- if flag == nil {
- return false
- }
- return flag.Changed
-}
-
-// Set sets the value of the named command-line flag.
-func Set(name, value string) error {
- return CommandLine.Set(name, value)
-}
-
-// PrintDefaults prints, to standard error unless configured
-// otherwise, the default values of all defined flags in the set.
-func (f *FlagSet) PrintDefaults() {
- usages := f.FlagUsages()
- fmt.Fprint(f.out(), usages)
-}
-
-// defaultIsZeroValue returns true if the default value for this flag represents
-// a zero value.
-func (f *Flag) defaultIsZeroValue() bool {
- switch f.Value.(type) {
- case boolFlag:
- return f.DefValue == "false"
- case *durationValue:
- // Beginning in Go 1.7, duration zero values are "0s"
- return f.DefValue == "0" || f.DefValue == "0s"
- case *intValue, *int8Value, *int32Value, *int64Value, *uintValue, *uint8Value, *uint16Value, *uint32Value, *uint64Value, *countValue, *float32Value, *float64Value:
- return f.DefValue == "0"
- case *stringValue:
- return f.DefValue == ""
- case *ipValue, *ipMaskValue, *ipNetValue:
- return f.DefValue == ""
- case *intSliceValue, *stringSliceValue, *stringArrayValue:
- return f.DefValue == "[]"
- default:
- switch f.Value.String() {
- case "false":
- return true
- case "":
- return true
- case "":
- return true
- case "0":
- return true
- }
- return false
- }
-}
-
-// UnquoteUsage extracts a back-quoted name from the usage
-// string for a flag and returns it and the un-quoted usage.
-// Given "a `name` to show" it returns ("name", "a name to show").
-// If there are no back quotes, the name is an educated guess of the
-// type of the flag's value, or the empty string if the flag is boolean.
-func UnquoteUsage(flag *Flag) (name string, usage string) {
- // Look for a back-quoted name, but avoid the strings package.
- usage = flag.Usage
- for i := 0; i < len(usage); i++ {
- if usage[i] == '`' {
- for j := i + 1; j < len(usage); j++ {
- if usage[j] == '`' {
- name = usage[i+1 : j]
- usage = usage[:i] + name + usage[j+1:]
- return name, usage
- }
- }
- break // Only one back quote; use type name.
- }
- }
-
- name = flag.Value.Type()
- switch name {
- case "bool":
- name = ""
- case "float64":
- name = "float"
- case "int64":
- name = "int"
- case "uint64":
- name = "uint"
- case "stringSlice":
- name = "strings"
- case "intSlice":
- name = "ints"
- case "uintSlice":
- name = "uints"
- case "boolSlice":
- name = "bools"
- }
-
- return
-}
-
-// Splits the string `s` on whitespace into an initial substring up to
-// `i` runes in length and the remainder. Will go `slop` over `i` if
-// that encompasses the entire string (which allows the caller to
-// avoid short orphan words on the final line).
-func wrapN(i, slop int, s string) (string, string) {
- if i+slop > len(s) {
- return s, ""
- }
-
- w := strings.LastIndexAny(s[:i], " \t\n")
- if w <= 0 {
- return s, ""
- }
- nlPos := strings.LastIndex(s[:i], "\n")
- if nlPos > 0 && nlPos < w {
- return s[:nlPos], s[nlPos+1:]
- }
- return s[:w], s[w+1:]
-}
-
-// Wraps the string `s` to a maximum width `w` with leading indent
-// `i`. The first line is not indented (this is assumed to be done by
-// caller). Pass `w` == 0 to do no wrapping
-func wrap(i, w int, s string) string {
- if w == 0 {
- return strings.Replace(s, "\n", "\n"+strings.Repeat(" ", i), -1)
- }
-
- // space between indent i and end of line width w into which
- // we should wrap the text.
- wrap := w - i
-
- var r, l string
-
- // Not enough space for sensible wrapping. Wrap as a block on
- // the next line instead.
- if wrap < 24 {
- i = 16
- wrap = w - i
- r += "\n" + strings.Repeat(" ", i)
- }
- // If still not enough space then don't even try to wrap.
- if wrap < 24 {
- return strings.Replace(s, "\n", r, -1)
- }
-
- // Try to avoid short orphan words on the final line, by
- // allowing wrapN to go a bit over if that would fit in the
- // remainder of the line.
- slop := 5
- wrap = wrap - slop
-
- // Handle first line, which is indented by the caller (or the
- // special case above)
- l, s = wrapN(wrap, slop, s)
- r = r + strings.Replace(l, "\n", "\n"+strings.Repeat(" ", i), -1)
-
- // Now wrap the rest
- for s != "" {
- var t string
-
- t, s = wrapN(wrap, slop, s)
- r = r + "\n" + strings.Repeat(" ", i) + strings.Replace(t, "\n", "\n"+strings.Repeat(" ", i), -1)
- }
-
- return r
-
-}
-
-// FlagUsagesWrapped returns a string containing the usage information
-// for all flags in the FlagSet. Wrapped to `cols` columns (0 for no
-// wrapping)
-func (f *FlagSet) FlagUsagesWrapped(cols int) string {
- buf := new(bytes.Buffer)
-
- lines := make([]string, 0, len(f.formal))
-
- maxlen := 0
- f.VisitAll(func(flag *Flag) {
- if flag.Hidden {
- return
- }
-
- line := ""
- if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
- line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name)
- } else {
- line = fmt.Sprintf(" --%s", flag.Name)
- }
-
- varname, usage := UnquoteUsage(flag)
- if varname != "" {
- line += " " + varname
- }
- if flag.NoOptDefVal != "" {
- switch flag.Value.Type() {
- case "string":
- line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal)
- case "bool":
- if flag.NoOptDefVal != "true" {
- line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
- }
- case "count":
- if flag.NoOptDefVal != "+1" {
- line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
- }
- default:
- line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
- }
- }
-
- // This special character will be replaced with spacing once the
- // correct alignment is calculated
- line += "\x00"
- if len(line) > maxlen {
- maxlen = len(line)
- }
-
- line += usage
- if !flag.defaultIsZeroValue() {
- if flag.Value.Type() == "string" {
- line += fmt.Sprintf(" (default %q)", flag.DefValue)
- } else {
- line += fmt.Sprintf(" (default %s)", flag.DefValue)
- }
- }
- if len(flag.Deprecated) != 0 {
- line += fmt.Sprintf(" (DEPRECATED: %s)", flag.Deprecated)
- }
-
- lines = append(lines, line)
- })
-
- for _, line := range lines {
- sidx := strings.Index(line, "\x00")
- spacing := strings.Repeat(" ", maxlen-sidx)
- // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx
- fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:]))
- }
-
- return buf.String()
-}
-
-// FlagUsages returns a string containing the usage information for all flags in
-// the FlagSet
-func (f *FlagSet) FlagUsages() string {
- return f.FlagUsagesWrapped(0)
-}
-
-// PrintDefaults prints to standard error the default values of all defined command-line flags.
-func PrintDefaults() {
- CommandLine.PrintDefaults()
-}
-
-// defaultUsage is the default function to print a usage message.
-func defaultUsage(f *FlagSet) {
- fmt.Fprintf(f.out(), "Usage of %s:\n", f.name)
- f.PrintDefaults()
-}
-
-// NOTE: Usage is not just defaultUsage(CommandLine)
-// because it serves (via godoc flag Usage) as the example
-// for how to write your own usage function.
-
-// Usage prints to standard error a usage message documenting all defined command-line flags.
-// The function is a variable that may be changed to point to a custom function.
-// By default it prints a simple header and calls PrintDefaults; for details about the
-// format of the output and how to control it, see the documentation for PrintDefaults.
-var Usage = func() {
- fmt.Fprintf(os.Stderr, "Usage of %s:\n", os.Args[0])
- PrintDefaults()
-}
-
-// NFlag returns the number of flags that have been set.
-func (f *FlagSet) NFlag() int { return len(f.actual) }
-
-// NFlag returns the number of command-line flags that have been set.
-func NFlag() int { return len(CommandLine.actual) }
-
-// Arg returns the i'th argument. Arg(0) is the first remaining argument
-// after flags have been processed.
-func (f *FlagSet) Arg(i int) string {
- if i < 0 || i >= len(f.args) {
- return ""
- }
- return f.args[i]
-}
-
-// Arg returns the i'th command-line argument. Arg(0) is the first remaining argument
-// after flags have been processed.
-func Arg(i int) string {
- return CommandLine.Arg(i)
-}
-
-// NArg is the number of arguments remaining after flags have been processed.
-func (f *FlagSet) NArg() int { return len(f.args) }
-
-// NArg is the number of arguments remaining after flags have been processed.
-func NArg() int { return len(CommandLine.args) }
-
-// Args returns the non-flag arguments.
-func (f *FlagSet) Args() []string { return f.args }
-
-// Args returns the non-flag command-line arguments.
-func Args() []string { return CommandLine.args }
-
-// Var defines a flag with the specified name and usage string. The type and
-// value of the flag are represented by the first argument, of type Value, which
-// typically holds a user-defined implementation of Value. For instance, the
-// caller could create a flag that turns a comma-separated string into a slice
-// of strings by giving the slice the methods of Value; in particular, Set would
-// decompose the comma-separated string into the slice.
-func (f *FlagSet) Var(value Value, name string, usage string) {
- f.VarP(value, name, "", usage)
-}
-
-// VarPF is like VarP, but returns the flag created
-func (f *FlagSet) VarPF(value Value, name, shorthand, usage string) *Flag {
- // Remember the default value as a string; it won't change.
- flag := &Flag{
- Name: name,
- Shorthand: shorthand,
- Usage: usage,
- Value: value,
- DefValue: value.String(),
- }
- f.AddFlag(flag)
- return flag
-}
-
-// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
- f.VarPF(value, name, shorthand, usage)
-}
-
-// AddFlag will add the flag to the FlagSet
-func (f *FlagSet) AddFlag(flag *Flag) {
- normalizedFlagName := f.normalizeFlagName(flag.Name)
-
- _, alreadyThere := f.formal[normalizedFlagName]
- if alreadyThere {
- msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name)
- fmt.Fprintln(f.out(), msg)
- panic(msg) // Happens only if flags are declared with identical names
- }
- if f.formal == nil {
- f.formal = make(map[NormalizedName]*Flag)
- }
-
- flag.Name = string(normalizedFlagName)
- f.formal[normalizedFlagName] = flag
- f.orderedFormal = append(f.orderedFormal, flag)
-
- if flag.Shorthand == "" {
- return
- }
- if len(flag.Shorthand) > 1 {
- msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand)
- fmt.Fprintf(f.out(), msg)
- panic(msg)
- }
- if f.shorthands == nil {
- f.shorthands = make(map[byte]*Flag)
- }
- c := flag.Shorthand[0]
- used, alreadyThere := f.shorthands[c]
- if alreadyThere {
- msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name)
- fmt.Fprintf(f.out(), msg)
- panic(msg)
- }
- f.shorthands[c] = flag
-}
-
-// AddFlagSet adds one FlagSet to another. If a flag is already present in f
-// the flag from newSet will be ignored.
-func (f *FlagSet) AddFlagSet(newSet *FlagSet) {
- if newSet == nil {
- return
- }
- newSet.VisitAll(func(flag *Flag) {
- if f.Lookup(flag.Name) == nil {
- f.AddFlag(flag)
- }
- })
-}
-
-// Var defines a flag with the specified name and usage string. The type and
-// value of the flag are represented by the first argument, of type Value, which
-// typically holds a user-defined implementation of Value. For instance, the
-// caller could create a flag that turns a comma-separated string into a slice
-// of strings by giving the slice the methods of Value; in particular, Set would
-// decompose the comma-separated string into the slice.
-func Var(value Value, name string, usage string) {
- CommandLine.VarP(value, name, "", usage)
-}
-
-// VarP is like Var, but accepts a shorthand letter that can be used after a single dash.
-func VarP(value Value, name, shorthand, usage string) {
- CommandLine.VarP(value, name, shorthand, usage)
-}
-
-// failf prints to standard error a formatted error and usage message and
-// returns the error.
-func (f *FlagSet) failf(format string, a ...interface{}) error {
- err := fmt.Errorf(format, a...)
- if f.errorHandling != ContinueOnError {
- fmt.Fprintln(f.out(), err)
- f.usage()
- }
- return err
-}
-
-// usage calls the Usage method for the flag set, or the usage function if
-// the flag set is CommandLine.
-func (f *FlagSet) usage() {
- if f == CommandLine {
- Usage()
- } else if f.Usage == nil {
- defaultUsage(f)
- } else {
- f.Usage()
- }
-}
-
-//--unknown (args will be empty)
-//--unknown --next-flag ... (args will be --next-flag ...)
-//--unknown arg ... (args will be arg ...)
-func stripUnknownFlagValue(args []string) []string {
- if len(args) == 0 {
- //--unknown
- return args
- }
-
- first := args[0]
- if len(first) > 0 && first[0] == '-' {
- //--unknown --next-flag ...
- return args
- }
-
- //--unknown arg ... (args will be arg ...)
- if len(args) > 1 {
- return args[1:]
- }
- return nil
-}
-
-func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) {
- a = args
- name := s[2:]
- if len(name) == 0 || name[0] == '-' || name[0] == '=' {
- err = f.failf("bad flag syntax: %s", s)
- return
- }
-
- split := strings.SplitN(name, "=", 2)
- name = split[0]
- flag, exists := f.formal[f.normalizeFlagName(name)]
-
- if !exists {
- switch {
- case name == "help":
- f.usage()
- return a, ErrHelp
- case f.ParseErrorsWhitelist.UnknownFlags:
- // --unknown=unknownval arg ...
- // we do not want to lose arg in this case
- if len(split) >= 2 {
- return a, nil
- }
-
- return stripUnknownFlagValue(a), nil
- default:
- err = f.failf("unknown flag: --%s", name)
- return
- }
- }
-
- var value string
- if len(split) == 2 {
- // '--flag=arg'
- value = split[1]
- } else if flag.NoOptDefVal != "" {
- // '--flag' (arg was optional)
- value = flag.NoOptDefVal
- } else if len(a) > 0 {
- // '--flag arg'
- value = a[0]
- a = a[1:]
- } else {
- // '--flag' (arg was required)
- err = f.failf("flag needs an argument: %s", s)
- return
- }
-
- err = fn(flag, value)
- if err != nil {
- f.failf(err.Error())
- }
- return
-}
-
-func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parseFunc) (outShorts string, outArgs []string, err error) {
- outArgs = args
-
- if strings.HasPrefix(shorthands, "test.") {
- return
- }
-
- outShorts = shorthands[1:]
- c := shorthands[0]
-
- flag, exists := f.shorthands[c]
- if !exists {
- switch {
- case c == 'h':
- f.usage()
- err = ErrHelp
- return
- case f.ParseErrorsWhitelist.UnknownFlags:
- // '-f=arg arg ...'
- // we do not want to lose arg in this case
- if len(shorthands) > 2 && shorthands[1] == '=' {
- outShorts = ""
- return
- }
-
- outArgs = stripUnknownFlagValue(outArgs)
- return
- default:
- err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands)
- return
- }
- }
-
- var value string
- if len(shorthands) > 2 && shorthands[1] == '=' {
- // '-f=arg'
- value = shorthands[2:]
- outShorts = ""
- } else if flag.NoOptDefVal != "" {
- // '-f' (arg was optional)
- value = flag.NoOptDefVal
- } else if len(shorthands) > 1 {
- // '-farg'
- value = shorthands[1:]
- outShorts = ""
- } else if len(args) > 0 {
- // '-f arg'
- value = args[0]
- outArgs = args[1:]
- } else {
- // '-f' (arg was required)
- err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
- return
- }
-
- if flag.ShorthandDeprecated != "" {
- fmt.Fprintf(f.out(), "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated)
- }
-
- err = fn(flag, value)
- if err != nil {
- f.failf(err.Error())
- }
- return
-}
-
-func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []string, err error) {
- a = args
- shorthands := s[1:]
-
- // "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv").
- for len(shorthands) > 0 {
- shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn)
- if err != nil {
- return
- }
- }
-
- return
-}
-
-func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) {
- for len(args) > 0 {
- s := args[0]
- args = args[1:]
- if len(s) == 0 || s[0] != '-' || len(s) == 1 {
- if !f.interspersed {
- f.args = append(f.args, s)
- f.args = append(f.args, args...)
- return nil
- }
- f.args = append(f.args, s)
- continue
- }
-
- if s[1] == '-' {
- if len(s) == 2 { // "--" terminates the flags
- f.argsLenAtDash = len(f.args)
- f.args = append(f.args, args...)
- break
- }
- args, err = f.parseLongArg(s, args, fn)
- } else {
- args, err = f.parseShortArg(s, args, fn)
- }
- if err != nil {
- return
- }
- }
- return
-}
-
-// Parse parses flag definitions from the argument list, which should not
-// include the command name. Must be called after all flags in the FlagSet
-// are defined and before flags are accessed by the program.
-// The return value will be ErrHelp if -help was set but not defined.
-func (f *FlagSet) Parse(arguments []string) error {
- if f.addedGoFlagSets != nil {
- for _, goFlagSet := range f.addedGoFlagSets {
- goFlagSet.Parse(nil)
- }
- }
- f.parsed = true
-
- if len(arguments) < 0 {
- return nil
- }
-
- f.args = make([]string, 0, len(arguments))
-
- set := func(flag *Flag, value string) error {
- return f.Set(flag.Name, value)
- }
-
- err := f.parseArgs(arguments, set)
- if err != nil {
- switch f.errorHandling {
- case ContinueOnError:
- return err
- case ExitOnError:
- fmt.Println(err)
- os.Exit(2)
- case PanicOnError:
- panic(err)
- }
- }
- return nil
-}
-
-type parseFunc func(flag *Flag, value string) error
-
-// ParseAll parses flag definitions from the argument list, which should not
-// include the command name. The arguments for fn are flag and value. Must be
-// called after all flags in the FlagSet are defined and before flags are
-// accessed by the program. The return value will be ErrHelp if -help was set
-// but not defined.
-func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string) error) error {
- f.parsed = true
- f.args = make([]string, 0, len(arguments))
-
- err := f.parseArgs(arguments, fn)
- if err != nil {
- switch f.errorHandling {
- case ContinueOnError:
- return err
- case ExitOnError:
- os.Exit(2)
- case PanicOnError:
- panic(err)
- }
- }
- return nil
-}
-
-// Parsed reports whether f.Parse has been called.
-func (f *FlagSet) Parsed() bool {
- return f.parsed
-}
-
-// Parse parses the command-line flags from os.Args[1:]. Must be called
-// after all flags are defined and before flags are accessed by the program.
-func Parse() {
- // Ignore errors; CommandLine is set for ExitOnError.
- CommandLine.Parse(os.Args[1:])
-}
-
-// ParseAll parses the command-line flags from os.Args[1:] and called fn for each.
-// The arguments for fn are flag and value. Must be called after all flags are
-// defined and before flags are accessed by the program.
-func ParseAll(fn func(flag *Flag, value string) error) {
- // Ignore errors; CommandLine is set for ExitOnError.
- CommandLine.ParseAll(os.Args[1:], fn)
-}
-
-// SetInterspersed sets whether to support interspersed option/non-option arguments.
-func SetInterspersed(interspersed bool) {
- CommandLine.SetInterspersed(interspersed)
-}
-
-// Parsed returns true if the command-line flags have been parsed.
-func Parsed() bool {
- return CommandLine.Parsed()
-}
-
-// CommandLine is the default set of command-line flags, parsed from os.Args.
-var CommandLine = NewFlagSet(os.Args[0], ExitOnError)
-
-// NewFlagSet returns a new, empty flag set with the specified name,
-// error handling property and SortFlags set to true.
-func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
- f := &FlagSet{
- name: name,
- errorHandling: errorHandling,
- argsLenAtDash: -1,
- interspersed: true,
- SortFlags: true,
- }
- return f
-}
-
-// SetInterspersed sets whether to support interspersed option/non-option arguments.
-func (f *FlagSet) SetInterspersed(interspersed bool) {
- f.interspersed = interspersed
-}
-
-// Init sets the name and error handling property for a flag set.
-// By default, the zero FlagSet uses an empty name and the
-// ContinueOnError error handling policy.
-func (f *FlagSet) Init(name string, errorHandling ErrorHandling) {
- f.name = name
- f.errorHandling = errorHandling
- f.argsLenAtDash = -1
-}
diff --git a/vendor/github.com/spf13/pflag/float32.go b/vendor/github.com/spf13/pflag/float32.go
deleted file mode 100644
index a243f81..0000000
--- a/vendor/github.com/spf13/pflag/float32.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- float32 Value
-type float32Value float32
-
-func newFloat32Value(val float32, p *float32) *float32Value {
- *p = val
- return (*float32Value)(p)
-}
-
-func (f *float32Value) Set(s string) error {
- v, err := strconv.ParseFloat(s, 32)
- *f = float32Value(v)
- return err
-}
-
-func (f *float32Value) Type() string {
- return "float32"
-}
-
-func (f *float32Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 32) }
-
-func float32Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseFloat(sval, 32)
- if err != nil {
- return 0, err
- }
- return float32(v), nil
-}
-
-// GetFloat32 return the float32 value of a flag with the given name
-func (f *FlagSet) GetFloat32(name string) (float32, error) {
- val, err := f.getFlagType(name, "float32", float32Conv)
- if err != nil {
- return 0, err
- }
- return val.(float32), nil
-}
-
-// Float32Var defines a float32 flag with specified name, default value, and usage string.
-// The argument p points to a float32 variable in which to store the value of the flag.
-func (f *FlagSet) Float32Var(p *float32, name string, value float32, usage string) {
- f.VarP(newFloat32Value(value, p), name, "", usage)
-}
-
-// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
- f.VarP(newFloat32Value(value, p), name, shorthand, usage)
-}
-
-// Float32Var defines a float32 flag with specified name, default value, and usage string.
-// The argument p points to a float32 variable in which to store the value of the flag.
-func Float32Var(p *float32, name string, value float32, usage string) {
- CommandLine.VarP(newFloat32Value(value, p), name, "", usage)
-}
-
-// Float32VarP is like Float32Var, but accepts a shorthand letter that can be used after a single dash.
-func Float32VarP(p *float32, name, shorthand string, value float32, usage string) {
- CommandLine.VarP(newFloat32Value(value, p), name, shorthand, usage)
-}
-
-// Float32 defines a float32 flag with specified name, default value, and usage string.
-// The return value is the address of a float32 variable that stores the value of the flag.
-func (f *FlagSet) Float32(name string, value float32, usage string) *float32 {
- p := new(float32)
- f.Float32VarP(p, name, "", value, usage)
- return p
-}
-
-// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float32P(name, shorthand string, value float32, usage string) *float32 {
- p := new(float32)
- f.Float32VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Float32 defines a float32 flag with specified name, default value, and usage string.
-// The return value is the address of a float32 variable that stores the value of the flag.
-func Float32(name string, value float32, usage string) *float32 {
- return CommandLine.Float32P(name, "", value, usage)
-}
-
-// Float32P is like Float32, but accepts a shorthand letter that can be used after a single dash.
-func Float32P(name, shorthand string, value float32, usage string) *float32 {
- return CommandLine.Float32P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/float64.go b/vendor/github.com/spf13/pflag/float64.go
deleted file mode 100644
index 04b5492..0000000
--- a/vendor/github.com/spf13/pflag/float64.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- float64 Value
-type float64Value float64
-
-func newFloat64Value(val float64, p *float64) *float64Value {
- *p = val
- return (*float64Value)(p)
-}
-
-func (f *float64Value) Set(s string) error {
- v, err := strconv.ParseFloat(s, 64)
- *f = float64Value(v)
- return err
-}
-
-func (f *float64Value) Type() string {
- return "float64"
-}
-
-func (f *float64Value) String() string { return strconv.FormatFloat(float64(*f), 'g', -1, 64) }
-
-func float64Conv(sval string) (interface{}, error) {
- return strconv.ParseFloat(sval, 64)
-}
-
-// GetFloat64 return the float64 value of a flag with the given name
-func (f *FlagSet) GetFloat64(name string) (float64, error) {
- val, err := f.getFlagType(name, "float64", float64Conv)
- if err != nil {
- return 0, err
- }
- return val.(float64), nil
-}
-
-// Float64Var defines a float64 flag with specified name, default value, and usage string.
-// The argument p points to a float64 variable in which to store the value of the flag.
-func (f *FlagSet) Float64Var(p *float64, name string, value float64, usage string) {
- f.VarP(newFloat64Value(value, p), name, "", usage)
-}
-
-// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
- f.VarP(newFloat64Value(value, p), name, shorthand, usage)
-}
-
-// Float64Var defines a float64 flag with specified name, default value, and usage string.
-// The argument p points to a float64 variable in which to store the value of the flag.
-func Float64Var(p *float64, name string, value float64, usage string) {
- CommandLine.VarP(newFloat64Value(value, p), name, "", usage)
-}
-
-// Float64VarP is like Float64Var, but accepts a shorthand letter that can be used after a single dash.
-func Float64VarP(p *float64, name, shorthand string, value float64, usage string) {
- CommandLine.VarP(newFloat64Value(value, p), name, shorthand, usage)
-}
-
-// Float64 defines a float64 flag with specified name, default value, and usage string.
-// The return value is the address of a float64 variable that stores the value of the flag.
-func (f *FlagSet) Float64(name string, value float64, usage string) *float64 {
- p := new(float64)
- f.Float64VarP(p, name, "", value, usage)
- return p
-}
-
-// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Float64P(name, shorthand string, value float64, usage string) *float64 {
- p := new(float64)
- f.Float64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Float64 defines a float64 flag with specified name, default value, and usage string.
-// The return value is the address of a float64 variable that stores the value of the flag.
-func Float64(name string, value float64, usage string) *float64 {
- return CommandLine.Float64P(name, "", value, usage)
-}
-
-// Float64P is like Float64, but accepts a shorthand letter that can be used after a single dash.
-func Float64P(name, shorthand string, value float64, usage string) *float64 {
- return CommandLine.Float64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/golangflag.go b/vendor/github.com/spf13/pflag/golangflag.go
deleted file mode 100644
index d3dd72b..0000000
--- a/vendor/github.com/spf13/pflag/golangflag.go
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2009 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package pflag
-
-import (
- goflag "flag"
- "reflect"
- "strings"
-)
-
-// flagValueWrapper implements pflag.Value around a flag.Value. The main
-// difference here is the addition of the Type method that returns a string
-// name of the type. As this is generally unknown, we approximate that with
-// reflection.
-type flagValueWrapper struct {
- inner goflag.Value
- flagType string
-}
-
-// We are just copying the boolFlag interface out of goflag as that is what
-// they use to decide if a flag should get "true" when no arg is given.
-type goBoolFlag interface {
- goflag.Value
- IsBoolFlag() bool
-}
-
-func wrapFlagValue(v goflag.Value) Value {
- // If the flag.Value happens to also be a pflag.Value, just use it directly.
- if pv, ok := v.(Value); ok {
- return pv
- }
-
- pv := &flagValueWrapper{
- inner: v,
- }
-
- t := reflect.TypeOf(v)
- if t.Kind() == reflect.Interface || t.Kind() == reflect.Ptr {
- t = t.Elem()
- }
-
- pv.flagType = strings.TrimSuffix(t.Name(), "Value")
- return pv
-}
-
-func (v *flagValueWrapper) String() string {
- return v.inner.String()
-}
-
-func (v *flagValueWrapper) Set(s string) error {
- return v.inner.Set(s)
-}
-
-func (v *flagValueWrapper) Type() string {
- return v.flagType
-}
-
-// PFlagFromGoFlag will return a *pflag.Flag given a *flag.Flag
-// If the *flag.Flag.Name was a single character (ex: `v`) it will be accessiblei
-// with both `-v` and `--v` in flags. If the golang flag was more than a single
-// character (ex: `verbose`) it will only be accessible via `--verbose`
-func PFlagFromGoFlag(goflag *goflag.Flag) *Flag {
- // Remember the default value as a string; it won't change.
- flag := &Flag{
- Name: goflag.Name,
- Usage: goflag.Usage,
- Value: wrapFlagValue(goflag.Value),
- // Looks like golang flags don't set DefValue correctly :-(
- //DefValue: goflag.DefValue,
- DefValue: goflag.Value.String(),
- }
- // Ex: if the golang flag was -v, allow both -v and --v to work
- if len(flag.Name) == 1 {
- flag.Shorthand = flag.Name
- }
- if fv, ok := goflag.Value.(goBoolFlag); ok && fv.IsBoolFlag() {
- flag.NoOptDefVal = "true"
- }
- return flag
-}
-
-// AddGoFlag will add the given *flag.Flag to the pflag.FlagSet
-func (f *FlagSet) AddGoFlag(goflag *goflag.Flag) {
- if f.Lookup(goflag.Name) != nil {
- return
- }
- newflag := PFlagFromGoFlag(goflag)
- f.AddFlag(newflag)
-}
-
-// AddGoFlagSet will add the given *flag.FlagSet to the pflag.FlagSet
-func (f *FlagSet) AddGoFlagSet(newSet *goflag.FlagSet) {
- if newSet == nil {
- return
- }
- newSet.VisitAll(func(goflag *goflag.Flag) {
- f.AddGoFlag(goflag)
- })
- if f.addedGoFlagSets == nil {
- f.addedGoFlagSets = make([]*goflag.FlagSet, 0)
- }
- f.addedGoFlagSets = append(f.addedGoFlagSets, newSet)
-}
diff --git a/vendor/github.com/spf13/pflag/int.go b/vendor/github.com/spf13/pflag/int.go
deleted file mode 100644
index 1474b89..0000000
--- a/vendor/github.com/spf13/pflag/int.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int Value
-type intValue int
-
-func newIntValue(val int, p *int) *intValue {
- *p = val
- return (*intValue)(p)
-}
-
-func (i *intValue) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 64)
- *i = intValue(v)
- return err
-}
-
-func (i *intValue) Type() string {
- return "int"
-}
-
-func (i *intValue) String() string { return strconv.Itoa(int(*i)) }
-
-func intConv(sval string) (interface{}, error) {
- return strconv.Atoi(sval)
-}
-
-// GetInt return the int value of a flag with the given name
-func (f *FlagSet) GetInt(name string) (int, error) {
- val, err := f.getFlagType(name, "int", intConv)
- if err != nil {
- return 0, err
- }
- return val.(int), nil
-}
-
-// IntVar defines an int flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-func (f *FlagSet) IntVar(p *int, name string, value int, usage string) {
- f.VarP(newIntValue(value, p), name, "", usage)
-}
-
-// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntVarP(p *int, name, shorthand string, value int, usage string) {
- f.VarP(newIntValue(value, p), name, shorthand, usage)
-}
-
-// IntVar defines an int flag with specified name, default value, and usage string.
-// The argument p points to an int variable in which to store the value of the flag.
-func IntVar(p *int, name string, value int, usage string) {
- CommandLine.VarP(newIntValue(value, p), name, "", usage)
-}
-
-// IntVarP is like IntVar, but accepts a shorthand letter that can be used after a single dash.
-func IntVarP(p *int, name, shorthand string, value int, usage string) {
- CommandLine.VarP(newIntValue(value, p), name, shorthand, usage)
-}
-
-// Int defines an int flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-func (f *FlagSet) Int(name string, value int, usage string) *int {
- p := new(int)
- f.IntVarP(p, name, "", value, usage)
- return p
-}
-
-// IntP is like Int, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntP(name, shorthand string, value int, usage string) *int {
- p := new(int)
- f.IntVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int defines an int flag with specified name, default value, and usage string.
-// The return value is the address of an int variable that stores the value of the flag.
-func Int(name string, value int, usage string) *int {
- return CommandLine.IntP(name, "", value, usage)
-}
-
-// IntP is like Int, but accepts a shorthand letter that can be used after a single dash.
-func IntP(name, shorthand string, value int, usage string) *int {
- return CommandLine.IntP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int16.go b/vendor/github.com/spf13/pflag/int16.go
deleted file mode 100644
index f1a01d0..0000000
--- a/vendor/github.com/spf13/pflag/int16.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int16 Value
-type int16Value int16
-
-func newInt16Value(val int16, p *int16) *int16Value {
- *p = val
- return (*int16Value)(p)
-}
-
-func (i *int16Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 16)
- *i = int16Value(v)
- return err
-}
-
-func (i *int16Value) Type() string {
- return "int16"
-}
-
-func (i *int16Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int16Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseInt(sval, 0, 16)
- if err != nil {
- return 0, err
- }
- return int16(v), nil
-}
-
-// GetInt16 returns the int16 value of a flag with the given name
-func (f *FlagSet) GetInt16(name string) (int16, error) {
- val, err := f.getFlagType(name, "int16", int16Conv)
- if err != nil {
- return 0, err
- }
- return val.(int16), nil
-}
-
-// Int16Var defines an int16 flag with specified name, default value, and usage string.
-// The argument p points to an int16 variable in which to store the value of the flag.
-func (f *FlagSet) Int16Var(p *int16, name string, value int16, usage string) {
- f.VarP(newInt16Value(value, p), name, "", usage)
-}
-
-// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int16VarP(p *int16, name, shorthand string, value int16, usage string) {
- f.VarP(newInt16Value(value, p), name, shorthand, usage)
-}
-
-// Int16Var defines an int16 flag with specified name, default value, and usage string.
-// The argument p points to an int16 variable in which to store the value of the flag.
-func Int16Var(p *int16, name string, value int16, usage string) {
- CommandLine.VarP(newInt16Value(value, p), name, "", usage)
-}
-
-// Int16VarP is like Int16Var, but accepts a shorthand letter that can be used after a single dash.
-func Int16VarP(p *int16, name, shorthand string, value int16, usage string) {
- CommandLine.VarP(newInt16Value(value, p), name, shorthand, usage)
-}
-
-// Int16 defines an int16 flag with specified name, default value, and usage string.
-// The return value is the address of an int16 variable that stores the value of the flag.
-func (f *FlagSet) Int16(name string, value int16, usage string) *int16 {
- p := new(int16)
- f.Int16VarP(p, name, "", value, usage)
- return p
-}
-
-// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int16P(name, shorthand string, value int16, usage string) *int16 {
- p := new(int16)
- f.Int16VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int16 defines an int16 flag with specified name, default value, and usage string.
-// The return value is the address of an int16 variable that stores the value of the flag.
-func Int16(name string, value int16, usage string) *int16 {
- return CommandLine.Int16P(name, "", value, usage)
-}
-
-// Int16P is like Int16, but accepts a shorthand letter that can be used after a single dash.
-func Int16P(name, shorthand string, value int16, usage string) *int16 {
- return CommandLine.Int16P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int32.go b/vendor/github.com/spf13/pflag/int32.go
deleted file mode 100644
index 9b95944..0000000
--- a/vendor/github.com/spf13/pflag/int32.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int32 Value
-type int32Value int32
-
-func newInt32Value(val int32, p *int32) *int32Value {
- *p = val
- return (*int32Value)(p)
-}
-
-func (i *int32Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 32)
- *i = int32Value(v)
- return err
-}
-
-func (i *int32Value) Type() string {
- return "int32"
-}
-
-func (i *int32Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int32Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseInt(sval, 0, 32)
- if err != nil {
- return 0, err
- }
- return int32(v), nil
-}
-
-// GetInt32 return the int32 value of a flag with the given name
-func (f *FlagSet) GetInt32(name string) (int32, error) {
- val, err := f.getFlagType(name, "int32", int32Conv)
- if err != nil {
- return 0, err
- }
- return val.(int32), nil
-}
-
-// Int32Var defines an int32 flag with specified name, default value, and usage string.
-// The argument p points to an int32 variable in which to store the value of the flag.
-func (f *FlagSet) Int32Var(p *int32, name string, value int32, usage string) {
- f.VarP(newInt32Value(value, p), name, "", usage)
-}
-
-// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
- f.VarP(newInt32Value(value, p), name, shorthand, usage)
-}
-
-// Int32Var defines an int32 flag with specified name, default value, and usage string.
-// The argument p points to an int32 variable in which to store the value of the flag.
-func Int32Var(p *int32, name string, value int32, usage string) {
- CommandLine.VarP(newInt32Value(value, p), name, "", usage)
-}
-
-// Int32VarP is like Int32Var, but accepts a shorthand letter that can be used after a single dash.
-func Int32VarP(p *int32, name, shorthand string, value int32, usage string) {
- CommandLine.VarP(newInt32Value(value, p), name, shorthand, usage)
-}
-
-// Int32 defines an int32 flag with specified name, default value, and usage string.
-// The return value is the address of an int32 variable that stores the value of the flag.
-func (f *FlagSet) Int32(name string, value int32, usage string) *int32 {
- p := new(int32)
- f.Int32VarP(p, name, "", value, usage)
- return p
-}
-
-// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int32P(name, shorthand string, value int32, usage string) *int32 {
- p := new(int32)
- f.Int32VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int32 defines an int32 flag with specified name, default value, and usage string.
-// The return value is the address of an int32 variable that stores the value of the flag.
-func Int32(name string, value int32, usage string) *int32 {
- return CommandLine.Int32P(name, "", value, usage)
-}
-
-// Int32P is like Int32, but accepts a shorthand letter that can be used after a single dash.
-func Int32P(name, shorthand string, value int32, usage string) *int32 {
- return CommandLine.Int32P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int64.go b/vendor/github.com/spf13/pflag/int64.go
deleted file mode 100644
index 0026d78..0000000
--- a/vendor/github.com/spf13/pflag/int64.go
+++ /dev/null
@@ -1,84 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int64 Value
-type int64Value int64
-
-func newInt64Value(val int64, p *int64) *int64Value {
- *p = val
- return (*int64Value)(p)
-}
-
-func (i *int64Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 64)
- *i = int64Value(v)
- return err
-}
-
-func (i *int64Value) Type() string {
- return "int64"
-}
-
-func (i *int64Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int64Conv(sval string) (interface{}, error) {
- return strconv.ParseInt(sval, 0, 64)
-}
-
-// GetInt64 return the int64 value of a flag with the given name
-func (f *FlagSet) GetInt64(name string) (int64, error) {
- val, err := f.getFlagType(name, "int64", int64Conv)
- if err != nil {
- return 0, err
- }
- return val.(int64), nil
-}
-
-// Int64Var defines an int64 flag with specified name, default value, and usage string.
-// The argument p points to an int64 variable in which to store the value of the flag.
-func (f *FlagSet) Int64Var(p *int64, name string, value int64, usage string) {
- f.VarP(newInt64Value(value, p), name, "", usage)
-}
-
-// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
- f.VarP(newInt64Value(value, p), name, shorthand, usage)
-}
-
-// Int64Var defines an int64 flag with specified name, default value, and usage string.
-// The argument p points to an int64 variable in which to store the value of the flag.
-func Int64Var(p *int64, name string, value int64, usage string) {
- CommandLine.VarP(newInt64Value(value, p), name, "", usage)
-}
-
-// Int64VarP is like Int64Var, but accepts a shorthand letter that can be used after a single dash.
-func Int64VarP(p *int64, name, shorthand string, value int64, usage string) {
- CommandLine.VarP(newInt64Value(value, p), name, shorthand, usage)
-}
-
-// Int64 defines an int64 flag with specified name, default value, and usage string.
-// The return value is the address of an int64 variable that stores the value of the flag.
-func (f *FlagSet) Int64(name string, value int64, usage string) *int64 {
- p := new(int64)
- f.Int64VarP(p, name, "", value, usage)
- return p
-}
-
-// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int64P(name, shorthand string, value int64, usage string) *int64 {
- p := new(int64)
- f.Int64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int64 defines an int64 flag with specified name, default value, and usage string.
-// The return value is the address of an int64 variable that stores the value of the flag.
-func Int64(name string, value int64, usage string) *int64 {
- return CommandLine.Int64P(name, "", value, usage)
-}
-
-// Int64P is like Int64, but accepts a shorthand letter that can be used after a single dash.
-func Int64P(name, shorthand string, value int64, usage string) *int64 {
- return CommandLine.Int64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int8.go b/vendor/github.com/spf13/pflag/int8.go
deleted file mode 100644
index 4da9222..0000000
--- a/vendor/github.com/spf13/pflag/int8.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- int8 Value
-type int8Value int8
-
-func newInt8Value(val int8, p *int8) *int8Value {
- *p = val
- return (*int8Value)(p)
-}
-
-func (i *int8Value) Set(s string) error {
- v, err := strconv.ParseInt(s, 0, 8)
- *i = int8Value(v)
- return err
-}
-
-func (i *int8Value) Type() string {
- return "int8"
-}
-
-func (i *int8Value) String() string { return strconv.FormatInt(int64(*i), 10) }
-
-func int8Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseInt(sval, 0, 8)
- if err != nil {
- return 0, err
- }
- return int8(v), nil
-}
-
-// GetInt8 return the int8 value of a flag with the given name
-func (f *FlagSet) GetInt8(name string) (int8, error) {
- val, err := f.getFlagType(name, "int8", int8Conv)
- if err != nil {
- return 0, err
- }
- return val.(int8), nil
-}
-
-// Int8Var defines an int8 flag with specified name, default value, and usage string.
-// The argument p points to an int8 variable in which to store the value of the flag.
-func (f *FlagSet) Int8Var(p *int8, name string, value int8, usage string) {
- f.VarP(newInt8Value(value, p), name, "", usage)
-}
-
-// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
- f.VarP(newInt8Value(value, p), name, shorthand, usage)
-}
-
-// Int8Var defines an int8 flag with specified name, default value, and usage string.
-// The argument p points to an int8 variable in which to store the value of the flag.
-func Int8Var(p *int8, name string, value int8, usage string) {
- CommandLine.VarP(newInt8Value(value, p), name, "", usage)
-}
-
-// Int8VarP is like Int8Var, but accepts a shorthand letter that can be used after a single dash.
-func Int8VarP(p *int8, name, shorthand string, value int8, usage string) {
- CommandLine.VarP(newInt8Value(value, p), name, shorthand, usage)
-}
-
-// Int8 defines an int8 flag with specified name, default value, and usage string.
-// The return value is the address of an int8 variable that stores the value of the flag.
-func (f *FlagSet) Int8(name string, value int8, usage string) *int8 {
- p := new(int8)
- f.Int8VarP(p, name, "", value, usage)
- return p
-}
-
-// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Int8P(name, shorthand string, value int8, usage string) *int8 {
- p := new(int8)
- f.Int8VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Int8 defines an int8 flag with specified name, default value, and usage string.
-// The return value is the address of an int8 variable that stores the value of the flag.
-func Int8(name string, value int8, usage string) *int8 {
- return CommandLine.Int8P(name, "", value, usage)
-}
-
-// Int8P is like Int8, but accepts a shorthand letter that can be used after a single dash.
-func Int8P(name, shorthand string, value int8, usage string) *int8 {
- return CommandLine.Int8P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/int_slice.go b/vendor/github.com/spf13/pflag/int_slice.go
deleted file mode 100644
index 1e7c9ed..0000000
--- a/vendor/github.com/spf13/pflag/int_slice.go
+++ /dev/null
@@ -1,128 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-// -- intSlice Value
-type intSliceValue struct {
- value *[]int
- changed bool
-}
-
-func newIntSliceValue(val []int, p *[]int) *intSliceValue {
- isv := new(intSliceValue)
- isv.value = p
- *isv.value = val
- return isv
-}
-
-func (s *intSliceValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make([]int, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = strconv.Atoi(d)
- if err != nil {
- return err
- }
-
- }
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
- s.changed = true
- return nil
-}
-
-func (s *intSliceValue) Type() string {
- return "intSlice"
-}
-
-func (s *intSliceValue) String() string {
- out := make([]string, len(*s.value))
- for i, d := range *s.value {
- out[i] = fmt.Sprintf("%d", d)
- }
- return "[" + strings.Join(out, ",") + "]"
-}
-
-func intSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []int{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]int, len(ss))
- for i, d := range ss {
- var err error
- out[i], err = strconv.Atoi(d)
- if err != nil {
- return nil, err
- }
-
- }
- return out, nil
-}
-
-// GetIntSlice return the []int value of a flag with the given name
-func (f *FlagSet) GetIntSlice(name string) ([]int, error) {
- val, err := f.getFlagType(name, "intSlice", intSliceConv)
- if err != nil {
- return []int{}, err
- }
- return val.([]int), nil
-}
-
-// IntSliceVar defines a intSlice flag with specified name, default value, and usage string.
-// The argument p points to a []int variable in which to store the value of the flag.
-func (f *FlagSet) IntSliceVar(p *[]int, name string, value []int, usage string) {
- f.VarP(newIntSliceValue(value, p), name, "", usage)
-}
-
-// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
- f.VarP(newIntSliceValue(value, p), name, shorthand, usage)
-}
-
-// IntSliceVar defines a int[] flag with specified name, default value, and usage string.
-// The argument p points to a int[] variable in which to store the value of the flag.
-func IntSliceVar(p *[]int, name string, value []int, usage string) {
- CommandLine.VarP(newIntSliceValue(value, p), name, "", usage)
-}
-
-// IntSliceVarP is like IntSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func IntSliceVarP(p *[]int, name, shorthand string, value []int, usage string) {
- CommandLine.VarP(newIntSliceValue(value, p), name, shorthand, usage)
-}
-
-// IntSlice defines a []int flag with specified name, default value, and usage string.
-// The return value is the address of a []int variable that stores the value of the flag.
-func (f *FlagSet) IntSlice(name string, value []int, usage string) *[]int {
- p := []int{}
- f.IntSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IntSliceP(name, shorthand string, value []int, usage string) *[]int {
- p := []int{}
- f.IntSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// IntSlice defines a []int flag with specified name, default value, and usage string.
-// The return value is the address of a []int variable that stores the value of the flag.
-func IntSlice(name string, value []int, usage string) *[]int {
- return CommandLine.IntSliceP(name, "", value, usage)
-}
-
-// IntSliceP is like IntSlice, but accepts a shorthand letter that can be used after a single dash.
-func IntSliceP(name, shorthand string, value []int, usage string) *[]int {
- return CommandLine.IntSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ip.go b/vendor/github.com/spf13/pflag/ip.go
deleted file mode 100644
index 3d414ba..0000000
--- a/vendor/github.com/spf13/pflag/ip.go
+++ /dev/null
@@ -1,94 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "net"
- "strings"
-)
-
-// -- net.IP value
-type ipValue net.IP
-
-func newIPValue(val net.IP, p *net.IP) *ipValue {
- *p = val
- return (*ipValue)(p)
-}
-
-func (i *ipValue) String() string { return net.IP(*i).String() }
-func (i *ipValue) Set(s string) error {
- ip := net.ParseIP(strings.TrimSpace(s))
- if ip == nil {
- return fmt.Errorf("failed to parse IP: %q", s)
- }
- *i = ipValue(ip)
- return nil
-}
-
-func (i *ipValue) Type() string {
- return "ip"
-}
-
-func ipConv(sval string) (interface{}, error) {
- ip := net.ParseIP(sval)
- if ip != nil {
- return ip, nil
- }
- return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
-}
-
-// GetIP return the net.IP value of a flag with the given name
-func (f *FlagSet) GetIP(name string) (net.IP, error) {
- val, err := f.getFlagType(name, "ip", ipConv)
- if err != nil {
- return nil, err
- }
- return val.(net.IP), nil
-}
-
-// IPVar defines an net.IP flag with specified name, default value, and usage string.
-// The argument p points to an net.IP variable in which to store the value of the flag.
-func (f *FlagSet) IPVar(p *net.IP, name string, value net.IP, usage string) {
- f.VarP(newIPValue(value, p), name, "", usage)
-}
-
-// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
- f.VarP(newIPValue(value, p), name, shorthand, usage)
-}
-
-// IPVar defines an net.IP flag with specified name, default value, and usage string.
-// The argument p points to an net.IP variable in which to store the value of the flag.
-func IPVar(p *net.IP, name string, value net.IP, usage string) {
- CommandLine.VarP(newIPValue(value, p), name, "", usage)
-}
-
-// IPVarP is like IPVar, but accepts a shorthand letter that can be used after a single dash.
-func IPVarP(p *net.IP, name, shorthand string, value net.IP, usage string) {
- CommandLine.VarP(newIPValue(value, p), name, shorthand, usage)
-}
-
-// IP defines an net.IP flag with specified name, default value, and usage string.
-// The return value is the address of an net.IP variable that stores the value of the flag.
-func (f *FlagSet) IP(name string, value net.IP, usage string) *net.IP {
- p := new(net.IP)
- f.IPVarP(p, name, "", value, usage)
- return p
-}
-
-// IPP is like IP, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPP(name, shorthand string, value net.IP, usage string) *net.IP {
- p := new(net.IP)
- f.IPVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// IP defines an net.IP flag with specified name, default value, and usage string.
-// The return value is the address of an net.IP variable that stores the value of the flag.
-func IP(name string, value net.IP, usage string) *net.IP {
- return CommandLine.IPP(name, "", value, usage)
-}
-
-// IPP is like IP, but accepts a shorthand letter that can be used after a single dash.
-func IPP(name, shorthand string, value net.IP, usage string) *net.IP {
- return CommandLine.IPP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ip_slice.go b/vendor/github.com/spf13/pflag/ip_slice.go
deleted file mode 100644
index 7dd196f..0000000
--- a/vendor/github.com/spf13/pflag/ip_slice.go
+++ /dev/null
@@ -1,148 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "io"
- "net"
- "strings"
-)
-
-// -- ipSlice Value
-type ipSliceValue struct {
- value *[]net.IP
- changed bool
-}
-
-func newIPSliceValue(val []net.IP, p *[]net.IP) *ipSliceValue {
- ipsv := new(ipSliceValue)
- ipsv.value = p
- *ipsv.value = val
- return ipsv
-}
-
-// Set converts, and assigns, the comma-separated IP argument string representation as the []net.IP value of this flag.
-// If Set is called on a flag that already has a []net.IP assigned, the newly converted values will be appended.
-func (s *ipSliceValue) Set(val string) error {
-
- // remove all quote characters
- rmQuote := strings.NewReplacer(`"`, "", `'`, "", "`", "")
-
- // read flag arguments with CSV parser
- ipStrSlice, err := readAsCSV(rmQuote.Replace(val))
- if err != nil && err != io.EOF {
- return err
- }
-
- // parse ip values into slice
- out := make([]net.IP, 0, len(ipStrSlice))
- for _, ipStr := range ipStrSlice {
- ip := net.ParseIP(strings.TrimSpace(ipStr))
- if ip == nil {
- return fmt.Errorf("invalid string being converted to IP address: %s", ipStr)
- }
- out = append(out, ip)
- }
-
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
-
- s.changed = true
-
- return nil
-}
-
-// Type returns a string that uniquely represents this flag's type.
-func (s *ipSliceValue) Type() string {
- return "ipSlice"
-}
-
-// String defines a "native" format for this net.IP slice flag value.
-func (s *ipSliceValue) String() string {
-
- ipStrSlice := make([]string, len(*s.value))
- for i, ip := range *s.value {
- ipStrSlice[i] = ip.String()
- }
-
- out, _ := writeAsCSV(ipStrSlice)
-
- return "[" + out + "]"
-}
-
-func ipSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Emtpy string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []net.IP{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]net.IP, len(ss))
- for i, sval := range ss {
- ip := net.ParseIP(strings.TrimSpace(sval))
- if ip == nil {
- return nil, fmt.Errorf("invalid string being converted to IP address: %s", sval)
- }
- out[i] = ip
- }
- return out, nil
-}
-
-// GetIPSlice returns the []net.IP value of a flag with the given name
-func (f *FlagSet) GetIPSlice(name string) ([]net.IP, error) {
- val, err := f.getFlagType(name, "ipSlice", ipSliceConv)
- if err != nil {
- return []net.IP{}, err
- }
- return val.([]net.IP), nil
-}
-
-// IPSliceVar defines a ipSlice flag with specified name, default value, and usage string.
-// The argument p points to a []net.IP variable in which to store the value of the flag.
-func (f *FlagSet) IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
- f.VarP(newIPSliceValue(value, p), name, "", usage)
-}
-
-// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
- f.VarP(newIPSliceValue(value, p), name, shorthand, usage)
-}
-
-// IPSliceVar defines a []net.IP flag with specified name, default value, and usage string.
-// The argument p points to a []net.IP variable in which to store the value of the flag.
-func IPSliceVar(p *[]net.IP, name string, value []net.IP, usage string) {
- CommandLine.VarP(newIPSliceValue(value, p), name, "", usage)
-}
-
-// IPSliceVarP is like IPSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func IPSliceVarP(p *[]net.IP, name, shorthand string, value []net.IP, usage string) {
- CommandLine.VarP(newIPSliceValue(value, p), name, shorthand, usage)
-}
-
-// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
-// The return value is the address of a []net.IP variable that stores the value of that flag.
-func (f *FlagSet) IPSlice(name string, value []net.IP, usage string) *[]net.IP {
- p := []net.IP{}
- f.IPSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
- p := []net.IP{}
- f.IPSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// IPSlice defines a []net.IP flag with specified name, default value, and usage string.
-// The return value is the address of a []net.IP variable that stores the value of the flag.
-func IPSlice(name string, value []net.IP, usage string) *[]net.IP {
- return CommandLine.IPSliceP(name, "", value, usage)
-}
-
-// IPSliceP is like IPSlice, but accepts a shorthand letter that can be used after a single dash.
-func IPSliceP(name, shorthand string, value []net.IP, usage string) *[]net.IP {
- return CommandLine.IPSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ipmask.go b/vendor/github.com/spf13/pflag/ipmask.go
deleted file mode 100644
index 5bd44bd..0000000
--- a/vendor/github.com/spf13/pflag/ipmask.go
+++ /dev/null
@@ -1,122 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "net"
- "strconv"
-)
-
-// -- net.IPMask value
-type ipMaskValue net.IPMask
-
-func newIPMaskValue(val net.IPMask, p *net.IPMask) *ipMaskValue {
- *p = val
- return (*ipMaskValue)(p)
-}
-
-func (i *ipMaskValue) String() string { return net.IPMask(*i).String() }
-func (i *ipMaskValue) Set(s string) error {
- ip := ParseIPv4Mask(s)
- if ip == nil {
- return fmt.Errorf("failed to parse IP mask: %q", s)
- }
- *i = ipMaskValue(ip)
- return nil
-}
-
-func (i *ipMaskValue) Type() string {
- return "ipMask"
-}
-
-// ParseIPv4Mask written in IP form (e.g. 255.255.255.0).
-// This function should really belong to the net package.
-func ParseIPv4Mask(s string) net.IPMask {
- mask := net.ParseIP(s)
- if mask == nil {
- if len(s) != 8 {
- return nil
- }
- // net.IPMask.String() actually outputs things like ffffff00
- // so write a horrible parser for that as well :-(
- m := []int{}
- for i := 0; i < 4; i++ {
- b := "0x" + s[2*i:2*i+2]
- d, err := strconv.ParseInt(b, 0, 0)
- if err != nil {
- return nil
- }
- m = append(m, int(d))
- }
- s := fmt.Sprintf("%d.%d.%d.%d", m[0], m[1], m[2], m[3])
- mask = net.ParseIP(s)
- if mask == nil {
- return nil
- }
- }
- return net.IPv4Mask(mask[12], mask[13], mask[14], mask[15])
-}
-
-func parseIPv4Mask(sval string) (interface{}, error) {
- mask := ParseIPv4Mask(sval)
- if mask == nil {
- return nil, fmt.Errorf("unable to parse %s as net.IPMask", sval)
- }
- return mask, nil
-}
-
-// GetIPv4Mask return the net.IPv4Mask value of a flag with the given name
-func (f *FlagSet) GetIPv4Mask(name string) (net.IPMask, error) {
- val, err := f.getFlagType(name, "ipMask", parseIPv4Mask)
- if err != nil {
- return nil, err
- }
- return val.(net.IPMask), nil
-}
-
-// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
-// The argument p points to an net.IPMask variable in which to store the value of the flag.
-func (f *FlagSet) IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
- f.VarP(newIPMaskValue(value, p), name, "", usage)
-}
-
-// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
- f.VarP(newIPMaskValue(value, p), name, shorthand, usage)
-}
-
-// IPMaskVar defines an net.IPMask flag with specified name, default value, and usage string.
-// The argument p points to an net.IPMask variable in which to store the value of the flag.
-func IPMaskVar(p *net.IPMask, name string, value net.IPMask, usage string) {
- CommandLine.VarP(newIPMaskValue(value, p), name, "", usage)
-}
-
-// IPMaskVarP is like IPMaskVar, but accepts a shorthand letter that can be used after a single dash.
-func IPMaskVarP(p *net.IPMask, name, shorthand string, value net.IPMask, usage string) {
- CommandLine.VarP(newIPMaskValue(value, p), name, shorthand, usage)
-}
-
-// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPMask variable that stores the value of the flag.
-func (f *FlagSet) IPMask(name string, value net.IPMask, usage string) *net.IPMask {
- p := new(net.IPMask)
- f.IPMaskVarP(p, name, "", value, usage)
- return p
-}
-
-// IPMaskP is like IPMask, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
- p := new(net.IPMask)
- f.IPMaskVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// IPMask defines an net.IPMask flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPMask variable that stores the value of the flag.
-func IPMask(name string, value net.IPMask, usage string) *net.IPMask {
- return CommandLine.IPMaskP(name, "", value, usage)
-}
-
-// IPMaskP is like IP, but accepts a shorthand letter that can be used after a single dash.
-func IPMaskP(name, shorthand string, value net.IPMask, usage string) *net.IPMask {
- return CommandLine.IPMaskP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/ipnet.go b/vendor/github.com/spf13/pflag/ipnet.go
deleted file mode 100644
index e2c1b8b..0000000
--- a/vendor/github.com/spf13/pflag/ipnet.go
+++ /dev/null
@@ -1,98 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "net"
- "strings"
-)
-
-// IPNet adapts net.IPNet for use as a flag.
-type ipNetValue net.IPNet
-
-func (ipnet ipNetValue) String() string {
- n := net.IPNet(ipnet)
- return n.String()
-}
-
-func (ipnet *ipNetValue) Set(value string) error {
- _, n, err := net.ParseCIDR(strings.TrimSpace(value))
- if err != nil {
- return err
- }
- *ipnet = ipNetValue(*n)
- return nil
-}
-
-func (*ipNetValue) Type() string {
- return "ipNet"
-}
-
-func newIPNetValue(val net.IPNet, p *net.IPNet) *ipNetValue {
- *p = val
- return (*ipNetValue)(p)
-}
-
-func ipNetConv(sval string) (interface{}, error) {
- _, n, err := net.ParseCIDR(strings.TrimSpace(sval))
- if err == nil {
- return *n, nil
- }
- return nil, fmt.Errorf("invalid string being converted to IPNet: %s", sval)
-}
-
-// GetIPNet return the net.IPNet value of a flag with the given name
-func (f *FlagSet) GetIPNet(name string) (net.IPNet, error) {
- val, err := f.getFlagType(name, "ipNet", ipNetConv)
- if err != nil {
- return net.IPNet{}, err
- }
- return val.(net.IPNet), nil
-}
-
-// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string.
-// The argument p points to an net.IPNet variable in which to store the value of the flag.
-func (f *FlagSet) IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
- f.VarP(newIPNetValue(value, p), name, "", usage)
-}
-
-// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) {
- f.VarP(newIPNetValue(value, p), name, shorthand, usage)
-}
-
-// IPNetVar defines an net.IPNet flag with specified name, default value, and usage string.
-// The argument p points to an net.IPNet variable in which to store the value of the flag.
-func IPNetVar(p *net.IPNet, name string, value net.IPNet, usage string) {
- CommandLine.VarP(newIPNetValue(value, p), name, "", usage)
-}
-
-// IPNetVarP is like IPNetVar, but accepts a shorthand letter that can be used after a single dash.
-func IPNetVarP(p *net.IPNet, name, shorthand string, value net.IPNet, usage string) {
- CommandLine.VarP(newIPNetValue(value, p), name, shorthand, usage)
-}
-
-// IPNet defines an net.IPNet flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPNet variable that stores the value of the flag.
-func (f *FlagSet) IPNet(name string, value net.IPNet, usage string) *net.IPNet {
- p := new(net.IPNet)
- f.IPNetVarP(p, name, "", value, usage)
- return p
-}
-
-// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet {
- p := new(net.IPNet)
- f.IPNetVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// IPNet defines an net.IPNet flag with specified name, default value, and usage string.
-// The return value is the address of an net.IPNet variable that stores the value of the flag.
-func IPNet(name string, value net.IPNet, usage string) *net.IPNet {
- return CommandLine.IPNetP(name, "", value, usage)
-}
-
-// IPNetP is like IPNet, but accepts a shorthand letter that can be used after a single dash.
-func IPNetP(name, shorthand string, value net.IPNet, usage string) *net.IPNet {
- return CommandLine.IPNetP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string.go b/vendor/github.com/spf13/pflag/string.go
deleted file mode 100644
index 04e0a26..0000000
--- a/vendor/github.com/spf13/pflag/string.go
+++ /dev/null
@@ -1,80 +0,0 @@
-package pflag
-
-// -- string Value
-type stringValue string
-
-func newStringValue(val string, p *string) *stringValue {
- *p = val
- return (*stringValue)(p)
-}
-
-func (s *stringValue) Set(val string) error {
- *s = stringValue(val)
- return nil
-}
-func (s *stringValue) Type() string {
- return "string"
-}
-
-func (s *stringValue) String() string { return string(*s) }
-
-func stringConv(sval string) (interface{}, error) {
- return sval, nil
-}
-
-// GetString return the string value of a flag with the given name
-func (f *FlagSet) GetString(name string) (string, error) {
- val, err := f.getFlagType(name, "string", stringConv)
- if err != nil {
- return "", err
- }
- return val.(string), nil
-}
-
-// StringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a string variable in which to store the value of the flag.
-func (f *FlagSet) StringVar(p *string, name string, value string, usage string) {
- f.VarP(newStringValue(value, p), name, "", usage)
-}
-
-// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringVarP(p *string, name, shorthand string, value string, usage string) {
- f.VarP(newStringValue(value, p), name, shorthand, usage)
-}
-
-// StringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a string variable in which to store the value of the flag.
-func StringVar(p *string, name string, value string, usage string) {
- CommandLine.VarP(newStringValue(value, p), name, "", usage)
-}
-
-// StringVarP is like StringVar, but accepts a shorthand letter that can be used after a single dash.
-func StringVarP(p *string, name, shorthand string, value string, usage string) {
- CommandLine.VarP(newStringValue(value, p), name, shorthand, usage)
-}
-
-// String defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a string variable that stores the value of the flag.
-func (f *FlagSet) String(name string, value string, usage string) *string {
- p := new(string)
- f.StringVarP(p, name, "", value, usage)
- return p
-}
-
-// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringP(name, shorthand string, value string, usage string) *string {
- p := new(string)
- f.StringVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// String defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a string variable that stores the value of the flag.
-func String(name string, value string, usage string) *string {
- return CommandLine.StringP(name, "", value, usage)
-}
-
-// StringP is like String, but accepts a shorthand letter that can be used after a single dash.
-func StringP(name, shorthand string, value string, usage string) *string {
- return CommandLine.StringP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_array.go b/vendor/github.com/spf13/pflag/string_array.go
deleted file mode 100644
index fa7bc60..0000000
--- a/vendor/github.com/spf13/pflag/string_array.go
+++ /dev/null
@@ -1,103 +0,0 @@
-package pflag
-
-// -- stringArray Value
-type stringArrayValue struct {
- value *[]string
- changed bool
-}
-
-func newStringArrayValue(val []string, p *[]string) *stringArrayValue {
- ssv := new(stringArrayValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-func (s *stringArrayValue) Set(val string) error {
- if !s.changed {
- *s.value = []string{val}
- s.changed = true
- } else {
- *s.value = append(*s.value, val)
- }
- return nil
-}
-
-func (s *stringArrayValue) Type() string {
- return "stringArray"
-}
-
-func (s *stringArrayValue) String() string {
- str, _ := writeAsCSV(*s.value)
- return "[" + str + "]"
-}
-
-func stringArrayConv(sval string) (interface{}, error) {
- sval = sval[1 : len(sval)-1]
- // An empty string would cause a array with one (empty) string
- if len(sval) == 0 {
- return []string{}, nil
- }
- return readAsCSV(sval)
-}
-
-// GetStringArray return the []string value of a flag with the given name
-func (f *FlagSet) GetStringArray(name string) ([]string, error) {
- val, err := f.getFlagType(name, "stringArray", stringArrayConv)
- if err != nil {
- return []string{}, err
- }
- return val.([]string), nil
-}
-
-// StringArrayVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the values of the multiple flags.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func (f *FlagSet) StringArrayVar(p *[]string, name string, value []string, usage string) {
- f.VarP(newStringArrayValue(value, p), name, "", usage)
-}
-
-// StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) {
- f.VarP(newStringArrayValue(value, p), name, shorthand, usage)
-}
-
-// StringArrayVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func StringArrayVar(p *[]string, name string, value []string, usage string) {
- CommandLine.VarP(newStringArrayValue(value, p), name, "", usage)
-}
-
-// StringArrayVarP is like StringArrayVar, but accepts a shorthand letter that can be used after a single dash.
-func StringArrayVarP(p *[]string, name, shorthand string, value []string, usage string) {
- CommandLine.VarP(newStringArrayValue(value, p), name, shorthand, usage)
-}
-
-// StringArray defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func (f *FlagSet) StringArray(name string, value []string, usage string) *[]string {
- p := []string{}
- f.StringArrayVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringArrayP(name, shorthand string, value []string, usage string) *[]string {
- p := []string{}
- f.StringArrayVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringArray defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma. Use a StringSlice for that.
-func StringArray(name string, value []string, usage string) *[]string {
- return CommandLine.StringArrayP(name, "", value, usage)
-}
-
-// StringArrayP is like StringArray, but accepts a shorthand letter that can be used after a single dash.
-func StringArrayP(name, shorthand string, value []string, usage string) *[]string {
- return CommandLine.StringArrayP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_slice.go b/vendor/github.com/spf13/pflag/string_slice.go
deleted file mode 100644
index 0cd3ccc..0000000
--- a/vendor/github.com/spf13/pflag/string_slice.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package pflag
-
-import (
- "bytes"
- "encoding/csv"
- "strings"
-)
-
-// -- stringSlice Value
-type stringSliceValue struct {
- value *[]string
- changed bool
-}
-
-func newStringSliceValue(val []string, p *[]string) *stringSliceValue {
- ssv := new(stringSliceValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-func readAsCSV(val string) ([]string, error) {
- if val == "" {
- return []string{}, nil
- }
- stringReader := strings.NewReader(val)
- csvReader := csv.NewReader(stringReader)
- return csvReader.Read()
-}
-
-func writeAsCSV(vals []string) (string, error) {
- b := &bytes.Buffer{}
- w := csv.NewWriter(b)
- err := w.Write(vals)
- if err != nil {
- return "", err
- }
- w.Flush()
- return strings.TrimSuffix(b.String(), "\n"), nil
-}
-
-func (s *stringSliceValue) Set(val string) error {
- v, err := readAsCSV(val)
- if err != nil {
- return err
- }
- if !s.changed {
- *s.value = v
- } else {
- *s.value = append(*s.value, v...)
- }
- s.changed = true
- return nil
-}
-
-func (s *stringSliceValue) Type() string {
- return "stringSlice"
-}
-
-func (s *stringSliceValue) String() string {
- str, _ := writeAsCSV(*s.value)
- return "[" + str + "]"
-}
-
-func stringSliceConv(sval string) (interface{}, error) {
- sval = sval[1 : len(sval)-1]
- // An empty string would cause a slice with one (empty) string
- if len(sval) == 0 {
- return []string{}, nil
- }
- return readAsCSV(sval)
-}
-
-// GetStringSlice return the []string value of a flag with the given name
-func (f *FlagSet) GetStringSlice(name string) ([]string, error) {
- val, err := f.getFlagType(name, "stringSlice", stringSliceConv)
- if err != nil {
- return []string{}, err
- }
- return val.([]string), nil
-}
-
-// StringSliceVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func (f *FlagSet) StringSliceVar(p *[]string, name string, value []string, usage string) {
- f.VarP(newStringSliceValue(value, p), name, "", usage)
-}
-
-// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
- f.VarP(newStringSliceValue(value, p), name, shorthand, usage)
-}
-
-// StringSliceVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a []string variable in which to store the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func StringSliceVar(p *[]string, name string, value []string, usage string) {
- CommandLine.VarP(newStringSliceValue(value, p), name, "", usage)
-}
-
-// StringSliceVarP is like StringSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func StringSliceVarP(p *[]string, name, shorthand string, value []string, usage string) {
- CommandLine.VarP(newStringSliceValue(value, p), name, shorthand, usage)
-}
-
-// StringSlice defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func (f *FlagSet) StringSlice(name string, value []string, usage string) *[]string {
- p := []string{}
- f.StringSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringSliceP(name, shorthand string, value []string, usage string) *[]string {
- p := []string{}
- f.StringSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringSlice defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a []string variable that stores the value of the flag.
-// Compared to StringArray flags, StringSlice flags take comma-separated value as arguments and split them accordingly.
-// For example:
-// --ss="v1,v2" -ss="v3"
-// will result in
-// []string{"v1", "v2", "v3"}
-func StringSlice(name string, value []string, usage string) *[]string {
- return CommandLine.StringSliceP(name, "", value, usage)
-}
-
-// StringSliceP is like StringSlice, but accepts a shorthand letter that can be used after a single dash.
-func StringSliceP(name, shorthand string, value []string, usage string) *[]string {
- return CommandLine.StringSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_to_int.go b/vendor/github.com/spf13/pflag/string_to_int.go
deleted file mode 100644
index 5ceda39..0000000
--- a/vendor/github.com/spf13/pflag/string_to_int.go
+++ /dev/null
@@ -1,149 +0,0 @@
-package pflag
-
-import (
- "bytes"
- "fmt"
- "strconv"
- "strings"
-)
-
-// -- stringToInt Value
-type stringToIntValue struct {
- value *map[string]int
- changed bool
-}
-
-func newStringToIntValue(val map[string]int, p *map[string]int) *stringToIntValue {
- ssv := new(stringToIntValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-// Format: a=1,b=2
-func (s *stringToIntValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make(map[string]int, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return fmt.Errorf("%s must be formatted as key=value", pair)
- }
- var err error
- out[kv[0]], err = strconv.Atoi(kv[1])
- if err != nil {
- return err
- }
- }
- if !s.changed {
- *s.value = out
- } else {
- for k, v := range out {
- (*s.value)[k] = v
- }
- }
- s.changed = true
- return nil
-}
-
-func (s *stringToIntValue) Type() string {
- return "stringToInt"
-}
-
-func (s *stringToIntValue) String() string {
- var buf bytes.Buffer
- i := 0
- for k, v := range *s.value {
- if i > 0 {
- buf.WriteRune(',')
- }
- buf.WriteString(k)
- buf.WriteRune('=')
- buf.WriteString(strconv.Itoa(v))
- i++
- }
- return "[" + buf.String() + "]"
-}
-
-func stringToIntConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // An empty string would cause an empty map
- if len(val) == 0 {
- return map[string]int{}, nil
- }
- ss := strings.Split(val, ",")
- out := make(map[string]int, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return nil, fmt.Errorf("%s must be formatted as key=value", pair)
- }
- var err error
- out[kv[0]], err = strconv.Atoi(kv[1])
- if err != nil {
- return nil, err
- }
- }
- return out, nil
-}
-
-// GetStringToInt return the map[string]int value of a flag with the given name
-func (f *FlagSet) GetStringToInt(name string) (map[string]int, error) {
- val, err := f.getFlagType(name, "stringToInt", stringToIntConv)
- if err != nil {
- return map[string]int{}, err
- }
- return val.(map[string]int), nil
-}
-
-// StringToIntVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]int variable in which to store the values of the multiple flags.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToIntVar(p *map[string]int, name string, value map[string]int, usage string) {
- f.VarP(newStringToIntValue(value, p), name, "", usage)
-}
-
-// StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToIntVarP(p *map[string]int, name, shorthand string, value map[string]int, usage string) {
- f.VarP(newStringToIntValue(value, p), name, shorthand, usage)
-}
-
-// StringToIntVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]int variable in which to store the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToIntVar(p *map[string]int, name string, value map[string]int, usage string) {
- CommandLine.VarP(newStringToIntValue(value, p), name, "", usage)
-}
-
-// StringToIntVarP is like StringToIntVar, but accepts a shorthand letter that can be used after a single dash.
-func StringToIntVarP(p *map[string]int, name, shorthand string, value map[string]int, usage string) {
- CommandLine.VarP(newStringToIntValue(value, p), name, shorthand, usage)
-}
-
-// StringToInt defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]int variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToInt(name string, value map[string]int, usage string) *map[string]int {
- p := map[string]int{}
- f.StringToIntVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int {
- p := map[string]int{}
- f.StringToIntVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringToInt defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]int variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToInt(name string, value map[string]int, usage string) *map[string]int {
- return CommandLine.StringToIntP(name, "", value, usage)
-}
-
-// StringToIntP is like StringToInt, but accepts a shorthand letter that can be used after a single dash.
-func StringToIntP(name, shorthand string, value map[string]int, usage string) *map[string]int {
- return CommandLine.StringToIntP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/string_to_string.go b/vendor/github.com/spf13/pflag/string_to_string.go
deleted file mode 100644
index 890a01a..0000000
--- a/vendor/github.com/spf13/pflag/string_to_string.go
+++ /dev/null
@@ -1,160 +0,0 @@
-package pflag
-
-import (
- "bytes"
- "encoding/csv"
- "fmt"
- "strings"
-)
-
-// -- stringToString Value
-type stringToStringValue struct {
- value *map[string]string
- changed bool
-}
-
-func newStringToStringValue(val map[string]string, p *map[string]string) *stringToStringValue {
- ssv := new(stringToStringValue)
- ssv.value = p
- *ssv.value = val
- return ssv
-}
-
-// Format: a=1,b=2
-func (s *stringToStringValue) Set(val string) error {
- var ss []string
- n := strings.Count(val, "=")
- switch n {
- case 0:
- return fmt.Errorf("%s must be formatted as key=value", val)
- case 1:
- ss = append(ss, strings.Trim(val, `"`))
- default:
- r := csv.NewReader(strings.NewReader(val))
- var err error
- ss, err = r.Read()
- if err != nil {
- return err
- }
- }
-
- out := make(map[string]string, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return fmt.Errorf("%s must be formatted as key=value", pair)
- }
- out[kv[0]] = kv[1]
- }
- if !s.changed {
- *s.value = out
- } else {
- for k, v := range out {
- (*s.value)[k] = v
- }
- }
- s.changed = true
- return nil
-}
-
-func (s *stringToStringValue) Type() string {
- return "stringToString"
-}
-
-func (s *stringToStringValue) String() string {
- records := make([]string, 0, len(*s.value)>>1)
- for k, v := range *s.value {
- records = append(records, k+"="+v)
- }
-
- var buf bytes.Buffer
- w := csv.NewWriter(&buf)
- if err := w.Write(records); err != nil {
- panic(err)
- }
- w.Flush()
- return "[" + strings.TrimSpace(buf.String()) + "]"
-}
-
-func stringToStringConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // An empty string would cause an empty map
- if len(val) == 0 {
- return map[string]string{}, nil
- }
- r := csv.NewReader(strings.NewReader(val))
- ss, err := r.Read()
- if err != nil {
- return nil, err
- }
- out := make(map[string]string, len(ss))
- for _, pair := range ss {
- kv := strings.SplitN(pair, "=", 2)
- if len(kv) != 2 {
- return nil, fmt.Errorf("%s must be formatted as key=value", pair)
- }
- out[kv[0]] = kv[1]
- }
- return out, nil
-}
-
-// GetStringToString return the map[string]string value of a flag with the given name
-func (f *FlagSet) GetStringToString(name string) (map[string]string, error) {
- val, err := f.getFlagType(name, "stringToString", stringToStringConv)
- if err != nil {
- return map[string]string{}, err
- }
- return val.(map[string]string), nil
-}
-
-// StringToStringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]string variable in which to store the values of the multiple flags.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToStringVar(p *map[string]string, name string, value map[string]string, usage string) {
- f.VarP(newStringToStringValue(value, p), name, "", usage)
-}
-
-// StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToStringVarP(p *map[string]string, name, shorthand string, value map[string]string, usage string) {
- f.VarP(newStringToStringValue(value, p), name, shorthand, usage)
-}
-
-// StringToStringVar defines a string flag with specified name, default value, and usage string.
-// The argument p points to a map[string]string variable in which to store the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToStringVar(p *map[string]string, name string, value map[string]string, usage string) {
- CommandLine.VarP(newStringToStringValue(value, p), name, "", usage)
-}
-
-// StringToStringVarP is like StringToStringVar, but accepts a shorthand letter that can be used after a single dash.
-func StringToStringVarP(p *map[string]string, name, shorthand string, value map[string]string, usage string) {
- CommandLine.VarP(newStringToStringValue(value, p), name, shorthand, usage)
-}
-
-// StringToString defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func (f *FlagSet) StringToString(name string, value map[string]string, usage string) *map[string]string {
- p := map[string]string{}
- f.StringToStringVarP(&p, name, "", value, usage)
- return &p
-}
-
-// StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) StringToStringP(name, shorthand string, value map[string]string, usage string) *map[string]string {
- p := map[string]string{}
- f.StringToStringVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// StringToString defines a string flag with specified name, default value, and usage string.
-// The return value is the address of a map[string]string variable that stores the value of the flag.
-// The value of each argument will not try to be separated by comma
-func StringToString(name string, value map[string]string, usage string) *map[string]string {
- return CommandLine.StringToStringP(name, "", value, usage)
-}
-
-// StringToStringP is like StringToString, but accepts a shorthand letter that can be used after a single dash.
-func StringToStringP(name, shorthand string, value map[string]string, usage string) *map[string]string {
- return CommandLine.StringToStringP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint.go b/vendor/github.com/spf13/pflag/uint.go
deleted file mode 100644
index dcbc2b7..0000000
--- a/vendor/github.com/spf13/pflag/uint.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint Value
-type uintValue uint
-
-func newUintValue(val uint, p *uint) *uintValue {
- *p = val
- return (*uintValue)(p)
-}
-
-func (i *uintValue) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 64)
- *i = uintValue(v)
- return err
-}
-
-func (i *uintValue) Type() string {
- return "uint"
-}
-
-func (i *uintValue) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uintConv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 0)
- if err != nil {
- return 0, err
- }
- return uint(v), nil
-}
-
-// GetUint return the uint value of a flag with the given name
-func (f *FlagSet) GetUint(name string) (uint, error) {
- val, err := f.getFlagType(name, "uint", uintConv)
- if err != nil {
- return 0, err
- }
- return val.(uint), nil
-}
-
-// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func (f *FlagSet) UintVar(p *uint, name string, value uint, usage string) {
- f.VarP(newUintValue(value, p), name, "", usage)
-}
-
-// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintVarP(p *uint, name, shorthand string, value uint, usage string) {
- f.VarP(newUintValue(value, p), name, shorthand, usage)
-}
-
-// UintVar defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func UintVar(p *uint, name string, value uint, usage string) {
- CommandLine.VarP(newUintValue(value, p), name, "", usage)
-}
-
-// UintVarP is like UintVar, but accepts a shorthand letter that can be used after a single dash.
-func UintVarP(p *uint, name, shorthand string, value uint, usage string) {
- CommandLine.VarP(newUintValue(value, p), name, shorthand, usage)
-}
-
-// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func (f *FlagSet) Uint(name string, value uint, usage string) *uint {
- p := new(uint)
- f.UintVarP(p, name, "", value, usage)
- return p
-}
-
-// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintP(name, shorthand string, value uint, usage string) *uint {
- p := new(uint)
- f.UintVarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func Uint(name string, value uint, usage string) *uint {
- return CommandLine.UintP(name, "", value, usage)
-}
-
-// UintP is like Uint, but accepts a shorthand letter that can be used after a single dash.
-func UintP(name, shorthand string, value uint, usage string) *uint {
- return CommandLine.UintP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint16.go b/vendor/github.com/spf13/pflag/uint16.go
deleted file mode 100644
index 7e9914e..0000000
--- a/vendor/github.com/spf13/pflag/uint16.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint16 value
-type uint16Value uint16
-
-func newUint16Value(val uint16, p *uint16) *uint16Value {
- *p = val
- return (*uint16Value)(p)
-}
-
-func (i *uint16Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 16)
- *i = uint16Value(v)
- return err
-}
-
-func (i *uint16Value) Type() string {
- return "uint16"
-}
-
-func (i *uint16Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint16Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 16)
- if err != nil {
- return 0, err
- }
- return uint16(v), nil
-}
-
-// GetUint16 return the uint16 value of a flag with the given name
-func (f *FlagSet) GetUint16(name string) (uint16, error) {
- val, err := f.getFlagType(name, "uint16", uint16Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint16), nil
-}
-
-// Uint16Var defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func (f *FlagSet) Uint16Var(p *uint16, name string, value uint16, usage string) {
- f.VarP(newUint16Value(value, p), name, "", usage)
-}
-
-// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
- f.VarP(newUint16Value(value, p), name, shorthand, usage)
-}
-
-// Uint16Var defines a uint flag with specified name, default value, and usage string.
-// The argument p points to a uint variable in which to store the value of the flag.
-func Uint16Var(p *uint16, name string, value uint16, usage string) {
- CommandLine.VarP(newUint16Value(value, p), name, "", usage)
-}
-
-// Uint16VarP is like Uint16Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint16VarP(p *uint16, name, shorthand string, value uint16, usage string) {
- CommandLine.VarP(newUint16Value(value, p), name, shorthand, usage)
-}
-
-// Uint16 defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func (f *FlagSet) Uint16(name string, value uint16, usage string) *uint16 {
- p := new(uint16)
- f.Uint16VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
- p := new(uint16)
- f.Uint16VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint16 defines a uint flag with specified name, default value, and usage string.
-// The return value is the address of a uint variable that stores the value of the flag.
-func Uint16(name string, value uint16, usage string) *uint16 {
- return CommandLine.Uint16P(name, "", value, usage)
-}
-
-// Uint16P is like Uint16, but accepts a shorthand letter that can be used after a single dash.
-func Uint16P(name, shorthand string, value uint16, usage string) *uint16 {
- return CommandLine.Uint16P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint32.go b/vendor/github.com/spf13/pflag/uint32.go
deleted file mode 100644
index d802453..0000000
--- a/vendor/github.com/spf13/pflag/uint32.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint32 value
-type uint32Value uint32
-
-func newUint32Value(val uint32, p *uint32) *uint32Value {
- *p = val
- return (*uint32Value)(p)
-}
-
-func (i *uint32Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 32)
- *i = uint32Value(v)
- return err
-}
-
-func (i *uint32Value) Type() string {
- return "uint32"
-}
-
-func (i *uint32Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint32Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 32)
- if err != nil {
- return 0, err
- }
- return uint32(v), nil
-}
-
-// GetUint32 return the uint32 value of a flag with the given name
-func (f *FlagSet) GetUint32(name string) (uint32, error) {
- val, err := f.getFlagType(name, "uint32", uint32Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint32), nil
-}
-
-// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
-// The argument p points to a uint32 variable in which to store the value of the flag.
-func (f *FlagSet) Uint32Var(p *uint32, name string, value uint32, usage string) {
- f.VarP(newUint32Value(value, p), name, "", usage)
-}
-
-// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
- f.VarP(newUint32Value(value, p), name, shorthand, usage)
-}
-
-// Uint32Var defines a uint32 flag with specified name, default value, and usage string.
-// The argument p points to a uint32 variable in which to store the value of the flag.
-func Uint32Var(p *uint32, name string, value uint32, usage string) {
- CommandLine.VarP(newUint32Value(value, p), name, "", usage)
-}
-
-// Uint32VarP is like Uint32Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint32VarP(p *uint32, name, shorthand string, value uint32, usage string) {
- CommandLine.VarP(newUint32Value(value, p), name, shorthand, usage)
-}
-
-// Uint32 defines a uint32 flag with specified name, default value, and usage string.
-// The return value is the address of a uint32 variable that stores the value of the flag.
-func (f *FlagSet) Uint32(name string, value uint32, usage string) *uint32 {
- p := new(uint32)
- f.Uint32VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
- p := new(uint32)
- f.Uint32VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint32 defines a uint32 flag with specified name, default value, and usage string.
-// The return value is the address of a uint32 variable that stores the value of the flag.
-func Uint32(name string, value uint32, usage string) *uint32 {
- return CommandLine.Uint32P(name, "", value, usage)
-}
-
-// Uint32P is like Uint32, but accepts a shorthand letter that can be used after a single dash.
-func Uint32P(name, shorthand string, value uint32, usage string) *uint32 {
- return CommandLine.Uint32P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint64.go b/vendor/github.com/spf13/pflag/uint64.go
deleted file mode 100644
index f62240f..0000000
--- a/vendor/github.com/spf13/pflag/uint64.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint64 Value
-type uint64Value uint64
-
-func newUint64Value(val uint64, p *uint64) *uint64Value {
- *p = val
- return (*uint64Value)(p)
-}
-
-func (i *uint64Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 64)
- *i = uint64Value(v)
- return err
-}
-
-func (i *uint64Value) Type() string {
- return "uint64"
-}
-
-func (i *uint64Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint64Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 64)
- if err != nil {
- return 0, err
- }
- return uint64(v), nil
-}
-
-// GetUint64 return the uint64 value of a flag with the given name
-func (f *FlagSet) GetUint64(name string) (uint64, error) {
- val, err := f.getFlagType(name, "uint64", uint64Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint64), nil
-}
-
-// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
-// The argument p points to a uint64 variable in which to store the value of the flag.
-func (f *FlagSet) Uint64Var(p *uint64, name string, value uint64, usage string) {
- f.VarP(newUint64Value(value, p), name, "", usage)
-}
-
-// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
- f.VarP(newUint64Value(value, p), name, shorthand, usage)
-}
-
-// Uint64Var defines a uint64 flag with specified name, default value, and usage string.
-// The argument p points to a uint64 variable in which to store the value of the flag.
-func Uint64Var(p *uint64, name string, value uint64, usage string) {
- CommandLine.VarP(newUint64Value(value, p), name, "", usage)
-}
-
-// Uint64VarP is like Uint64Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint64VarP(p *uint64, name, shorthand string, value uint64, usage string) {
- CommandLine.VarP(newUint64Value(value, p), name, shorthand, usage)
-}
-
-// Uint64 defines a uint64 flag with specified name, default value, and usage string.
-// The return value is the address of a uint64 variable that stores the value of the flag.
-func (f *FlagSet) Uint64(name string, value uint64, usage string) *uint64 {
- p := new(uint64)
- f.Uint64VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
- p := new(uint64)
- f.Uint64VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint64 defines a uint64 flag with specified name, default value, and usage string.
-// The return value is the address of a uint64 variable that stores the value of the flag.
-func Uint64(name string, value uint64, usage string) *uint64 {
- return CommandLine.Uint64P(name, "", value, usage)
-}
-
-// Uint64P is like Uint64, but accepts a shorthand letter that can be used after a single dash.
-func Uint64P(name, shorthand string, value uint64, usage string) *uint64 {
- return CommandLine.Uint64P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint8.go b/vendor/github.com/spf13/pflag/uint8.go
deleted file mode 100644
index bb0e83c..0000000
--- a/vendor/github.com/spf13/pflag/uint8.go
+++ /dev/null
@@ -1,88 +0,0 @@
-package pflag
-
-import "strconv"
-
-// -- uint8 Value
-type uint8Value uint8
-
-func newUint8Value(val uint8, p *uint8) *uint8Value {
- *p = val
- return (*uint8Value)(p)
-}
-
-func (i *uint8Value) Set(s string) error {
- v, err := strconv.ParseUint(s, 0, 8)
- *i = uint8Value(v)
- return err
-}
-
-func (i *uint8Value) Type() string {
- return "uint8"
-}
-
-func (i *uint8Value) String() string { return strconv.FormatUint(uint64(*i), 10) }
-
-func uint8Conv(sval string) (interface{}, error) {
- v, err := strconv.ParseUint(sval, 0, 8)
- if err != nil {
- return 0, err
- }
- return uint8(v), nil
-}
-
-// GetUint8 return the uint8 value of a flag with the given name
-func (f *FlagSet) GetUint8(name string) (uint8, error) {
- val, err := f.getFlagType(name, "uint8", uint8Conv)
- if err != nil {
- return 0, err
- }
- return val.(uint8), nil
-}
-
-// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
-// The argument p points to a uint8 variable in which to store the value of the flag.
-func (f *FlagSet) Uint8Var(p *uint8, name string, value uint8, usage string) {
- f.VarP(newUint8Value(value, p), name, "", usage)
-}
-
-// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
- f.VarP(newUint8Value(value, p), name, shorthand, usage)
-}
-
-// Uint8Var defines a uint8 flag with specified name, default value, and usage string.
-// The argument p points to a uint8 variable in which to store the value of the flag.
-func Uint8Var(p *uint8, name string, value uint8, usage string) {
- CommandLine.VarP(newUint8Value(value, p), name, "", usage)
-}
-
-// Uint8VarP is like Uint8Var, but accepts a shorthand letter that can be used after a single dash.
-func Uint8VarP(p *uint8, name, shorthand string, value uint8, usage string) {
- CommandLine.VarP(newUint8Value(value, p), name, shorthand, usage)
-}
-
-// Uint8 defines a uint8 flag with specified name, default value, and usage string.
-// The return value is the address of a uint8 variable that stores the value of the flag.
-func (f *FlagSet) Uint8(name string, value uint8, usage string) *uint8 {
- p := new(uint8)
- f.Uint8VarP(p, name, "", value, usage)
- return p
-}
-
-// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
- p := new(uint8)
- f.Uint8VarP(p, name, shorthand, value, usage)
- return p
-}
-
-// Uint8 defines a uint8 flag with specified name, default value, and usage string.
-// The return value is the address of a uint8 variable that stores the value of the flag.
-func Uint8(name string, value uint8, usage string) *uint8 {
- return CommandLine.Uint8P(name, "", value, usage)
-}
-
-// Uint8P is like Uint8, but accepts a shorthand letter that can be used after a single dash.
-func Uint8P(name, shorthand string, value uint8, usage string) *uint8 {
- return CommandLine.Uint8P(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/spf13/pflag/uint_slice.go b/vendor/github.com/spf13/pflag/uint_slice.go
deleted file mode 100644
index edd94c6..0000000
--- a/vendor/github.com/spf13/pflag/uint_slice.go
+++ /dev/null
@@ -1,126 +0,0 @@
-package pflag
-
-import (
- "fmt"
- "strconv"
- "strings"
-)
-
-// -- uintSlice Value
-type uintSliceValue struct {
- value *[]uint
- changed bool
-}
-
-func newUintSliceValue(val []uint, p *[]uint) *uintSliceValue {
- uisv := new(uintSliceValue)
- uisv.value = p
- *uisv.value = val
- return uisv
-}
-
-func (s *uintSliceValue) Set(val string) error {
- ss := strings.Split(val, ",")
- out := make([]uint, len(ss))
- for i, d := range ss {
- u, err := strconv.ParseUint(d, 10, 0)
- if err != nil {
- return err
- }
- out[i] = uint(u)
- }
- if !s.changed {
- *s.value = out
- } else {
- *s.value = append(*s.value, out...)
- }
- s.changed = true
- return nil
-}
-
-func (s *uintSliceValue) Type() string {
- return "uintSlice"
-}
-
-func (s *uintSliceValue) String() string {
- out := make([]string, len(*s.value))
- for i, d := range *s.value {
- out[i] = fmt.Sprintf("%d", d)
- }
- return "[" + strings.Join(out, ",") + "]"
-}
-
-func uintSliceConv(val string) (interface{}, error) {
- val = strings.Trim(val, "[]")
- // Empty string would cause a slice with one (empty) entry
- if len(val) == 0 {
- return []uint{}, nil
- }
- ss := strings.Split(val, ",")
- out := make([]uint, len(ss))
- for i, d := range ss {
- u, err := strconv.ParseUint(d, 10, 0)
- if err != nil {
- return nil, err
- }
- out[i] = uint(u)
- }
- return out, nil
-}
-
-// GetUintSlice returns the []uint value of a flag with the given name.
-func (f *FlagSet) GetUintSlice(name string) ([]uint, error) {
- val, err := f.getFlagType(name, "uintSlice", uintSliceConv)
- if err != nil {
- return []uint{}, err
- }
- return val.([]uint), nil
-}
-
-// UintSliceVar defines a uintSlice flag with specified name, default value, and usage string.
-// The argument p points to a []uint variable in which to store the value of the flag.
-func (f *FlagSet) UintSliceVar(p *[]uint, name string, value []uint, usage string) {
- f.VarP(newUintSliceValue(value, p), name, "", usage)
-}
-
-// UintSliceVarP is like UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
- f.VarP(newUintSliceValue(value, p), name, shorthand, usage)
-}
-
-// UintSliceVar defines a uint[] flag with specified name, default value, and usage string.
-// The argument p points to a uint[] variable in which to store the value of the flag.
-func UintSliceVar(p *[]uint, name string, value []uint, usage string) {
- CommandLine.VarP(newUintSliceValue(value, p), name, "", usage)
-}
-
-// UintSliceVarP is like the UintSliceVar, but accepts a shorthand letter that can be used after a single dash.
-func UintSliceVarP(p *[]uint, name, shorthand string, value []uint, usage string) {
- CommandLine.VarP(newUintSliceValue(value, p), name, shorthand, usage)
-}
-
-// UintSlice defines a []uint flag with specified name, default value, and usage string.
-// The return value is the address of a []uint variable that stores the value of the flag.
-func (f *FlagSet) UintSlice(name string, value []uint, usage string) *[]uint {
- p := []uint{}
- f.UintSliceVarP(&p, name, "", value, usage)
- return &p
-}
-
-// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
-func (f *FlagSet) UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
- p := []uint{}
- f.UintSliceVarP(&p, name, shorthand, value, usage)
- return &p
-}
-
-// UintSlice defines a []uint flag with specified name, default value, and usage string.
-// The return value is the address of a []uint variable that stores the value of the flag.
-func UintSlice(name string, value []uint, usage string) *[]uint {
- return CommandLine.UintSliceP(name, "", value, usage)
-}
-
-// UintSliceP is like UintSlice, but accepts a shorthand letter that can be used after a single dash.
-func UintSliceP(name, shorthand string, value []uint, usage string) *[]uint {
- return CommandLine.UintSliceP(name, shorthand, value, usage)
-}
diff --git a/vendor/github.com/tredoe/osutil/AUTHORS.md b/vendor/github.com/tredoe/osutil/AUTHORS.md
deleted file mode 100644
index 1a575d3..0000000
--- a/vendor/github.com/tredoe/osutil/AUTHORS.md
+++ /dev/null
@@ -1,16 +0,0 @@
-# Authors
-
-This is the official list of authors for copyright purposes.
-This file is distinct from the 'CONTRIBUTORS' file. See the latter for an explanation.
-
-Names should be added to this file as:
-
- Name or Organization / (url address)
-
-(The email address is not required for organizations)
-
-Please keep the list sorted.
-
-## Code
-
-* Jonas mg (https://github.com/tredoe)
\ No newline at end of file
diff --git a/vendor/github.com/tredoe/osutil/CONTRIBUTORS.md b/vendor/github.com/tredoe/osutil/CONTRIBUTORS.md
deleted file mode 100644
index 879ecc2..0000000
--- a/vendor/github.com/tredoe/osutil/CONTRIBUTORS.md
+++ /dev/null
@@ -1,18 +0,0 @@
-# Contributors
-
-This is the official list of people who can contribute (and typically
-have contributed) to the repository.
-
-The 'AUTHORS' file lists the copyright holders; this file lists people. For
-example, the employees of an organization are listed here but not in 'AUTHORS',
-because the organization holds the copyright.
-
-Names should be added to this file as:
-
- Name / (url address)
-
-Please keep the list sorted.
-
-## Code
-
-* Jonas mg (https://github.com/tredoe)
\ No newline at end of file
diff --git a/vendor/github.com/tredoe/osutil/LICENSE-MPL.txt b/vendor/github.com/tredoe/osutil/LICENSE-MPL.txt
deleted file mode 100644
index 52d1351..0000000
--- a/vendor/github.com/tredoe/osutil/LICENSE-MPL.txt
+++ /dev/null
@@ -1,374 +0,0 @@
-Mozilla Public License Version 2.0
-==================================
-
-1. Definitions
---------------
-
-1.1. "Contributor"
- means each individual or legal entity that creates, contributes to
- the creation of, or owns Covered Software.
-
-1.2. "Contributor Version"
- means the combination of the Contributions of others (if any) used
- by a Contributor and that particular Contributor's Contribution.
-
-1.3. "Contribution"
- means Covered Software of a particular Contributor.
-
-1.4. "Covered Software"
- means Source Code Form to which the initial Contributor has attached
- the notice in Exhibit A, the Executable Form of such Source Code
- Form, and Modifications of such Source Code Form, in each case
- including portions thereof.
-
-1.5. "Incompatible With Secondary Licenses"
- means
-
- (a) that the initial Contributor has attached the notice described
- in Exhibit B to the Covered Software; or
-
- (b) that the Covered Software was made available under the terms of
- version 1.1 or earlier of the License, but not also under the
- terms of a Secondary License.
-
-1.6. "Executable Form"
- means any form of the work other than Source Code Form.
-
-1.7. "Larger Work"
- means a work that combines Covered Software with other material, in
- a separate file or files, that is not Covered Software.
-
-1.8. "License"
- means this document.
-
-1.9. "Licensable"
- means having the right to grant, to the maximum extent possible,
- whether at the time of the initial grant or subsequently, any and
- all of the rights conveyed by this License.
-
-1.10. "Modifications"
- means any of the following:
-
- (a) any file in Source Code Form that results from an addition to,
- deletion from, or modification of the contents of Covered
- Software; or
-
- (b) any new file in Source Code Form that contains any Covered
- Software.
-
-1.11. "Patent Claims" of a Contributor
- means any patent claim(s), including without limitation, method,
- process, and apparatus claims, in any patent Licensable by such
- Contributor that would be infringed, but for the grant of the
- License, by the making, using, selling, offering for sale, having
- made, import, or transfer of either its Contributions or its
- Contributor Version.
-
-1.12. "Secondary License"
- means either the GNU General Public License, Version 2.0, the GNU
- Lesser General Public License, Version 2.1, the GNU Affero General
- Public License, Version 3.0, or any later versions of those
- licenses.
-
-1.13. "Source Code Form"
- means the form of the work preferred for making modifications.
-
-1.14. "You" (or "Your")
- means an individual or a legal entity exercising rights under this
- License. For legal entities, "You" includes any entity that
- controls, is controlled by, or is under common control with You. For
- purposes of this definition, "control" means (a) the power, direct
- or indirect, to cause the direction or management of such entity,
- whether by contract or otherwise, or (b) ownership of more than
- fifty percent (50%) of the outstanding shares or beneficial
- ownership of such entity.
-
-2. License Grants and Conditions
---------------------------------
-
-2.1. Grants
-
-Each Contributor hereby grants You a world-wide, royalty-free,
-non-exclusive license:
-
-(a) under intellectual property rights (other than patent or trademark)
- Licensable by such Contributor to use, reproduce, make available,
- modify, display, perform, distribute, and otherwise exploit its
- Contributions, either on an unmodified basis, with Modifications, or
- as part of a Larger Work; and
-
-(b) under Patent Claims of such Contributor to make, use, sell, offer
- for sale, have made, import, and otherwise transfer either its
- Contributions or its Contributor Version.
-
-2.2. Effective Date
-
-The licenses granted in Section 2.1 with respect to any Contribution
-become effective for each Contribution on the date the Contributor first
-distributes such Contribution.
-
-2.3. Limitations on Grant Scope
-
-The licenses granted in this Section 2 are the only rights granted under
-this License. No additional rights or licenses will be implied from the
-distribution or licensing of Covered Software under this License.
-Notwithstanding Section 2.1(b) above, no patent license is granted by a
-Contributor:
-
-(a) for any code that a Contributor has removed from Covered Software;
- or
-
-(b) for infringements caused by: (i) Your and any other third party's
- modifications of Covered Software, or (ii) the combination of its
- Contributions with other software (except as part of its Contributor
- Version); or
-
-(c) under Patent Claims infringed by Covered Software in the absence of
- its Contributions.
-
-This License does not grant any rights in the trademarks, service marks,
-or logos of any Contributor (except as may be necessary to comply with
-the notice requirements in Section 3.4).
-
-2.4. Subsequent Licenses
-
-No Contributor makes additional grants as a result of Your choice to
-distribute the Covered Software under a subsequent version of this
-License (see Section 10.2) or under the terms of a Secondary License (if
-permitted under the terms of Section 3.3).
-
-2.5. Representation
-
-Each Contributor represents that the Contributor believes its
-Contributions are its original creation(s) or it has sufficient rights
-to grant the rights to its Contributions conveyed by this License.
-
-2.6. Fair Use
-
-This License is not intended to limit any rights You have under
-applicable copyright doctrines of fair use, fair dealing, or other
-equivalents.
-
-2.7. Conditions
-
-Sections 3.1, 3.2, 3.3, and 3.4 are conditions of the licenses granted
-in Section 2.1.
-
-3. Responsibilities
--------------------
-
-3.1. Distribution of Source Form
-
-All distribution of Covered Software in Source Code Form, including any
-Modifications that You create or to which You contribute, must be under
-the terms of this License. You must inform recipients that the Source
-Code Form of the Covered Software is governed by the terms of this
-License, and how they can obtain a copy of this License. You may not
-attempt to alter or restrict the recipients' rights in the Source Code
-Form.
-
-3.2. Distribution of Executable Form
-
-If You distribute Covered Software in Executable Form then:
-
-(a) such Covered Software must also be made available in Source Code
- Form, as described in Section 3.1, and You must inform recipients of
- the Executable Form how they can obtain a copy of such Source Code
- Form by reasonable means in a timely manner, at a charge no more
- than the cost of distribution to the recipient; and
-
-(b) You may distribute such Executable Form under the terms of this
- License, or sublicense it under different terms, provided that the
- license for the Executable Form does not attempt to limit or alter
- the recipients' rights in the Source Code Form under this License.
-
-3.3. Distribution of a Larger Work
-
-You may create and distribute a Larger Work under terms of Your choice,
-provided that You also comply with the requirements of this License for
-the Covered Software. If the Larger Work is a combination of Covered
-Software with a work governed by one or more Secondary Licenses, and the
-Covered Software is not Incompatible With Secondary Licenses, this
-License permits You to additionally distribute such Covered Software
-under the terms of such Secondary License(s), so that the recipient of
-the Larger Work may, at their option, further distribute the Covered
-Software under the terms of either this License or such Secondary
-License(s).
-
-3.4. Notices
-
-You may not remove or alter the substance of any license notices
-(including copyright notices, patent notices, disclaimers of warranty,
-or limitations of liability) contained within the Source Code Form of
-the Covered Software, except that You may alter any license notices to
-the extent required to remedy known factual inaccuracies.
-
-3.5. Application of Additional Terms
-
-You may choose to offer, and to charge a fee for, warranty, support,
-indemnity or liability obligations to one or more recipients of Covered
-Software. However, You may do so only on Your own behalf, and not on
-behalf of any Contributor. You must make it absolutely clear that any
-such warranty, support, indemnity, or liability obligation is offered by
-You alone, and You hereby agree to indemnify every Contributor for any
-liability incurred by such Contributor as a result of warranty, support,
-indemnity or liability terms You offer. You may include additional
-disclaimers of warranty and limitations of liability specific to any
-jurisdiction.
-
-4. Inability to Comply Due to Statute or Regulation
----------------------------------------------------
-
-If it is impossible for You to comply with any of the terms of this
-License with respect to some or all of the Covered Software due to
-statute, judicial order, or regulation then You must: (a) comply with
-the terms of this License to the maximum extent possible; and (b)
-describe the limitations and the code they affect. Such description must
-be placed in a text file included with all distributions of the Covered
-Software under this License. Except to the extent prohibited by statute
-or regulation, such description must be sufficiently detailed for a
-recipient of ordinary skill to be able to understand it.
-
-5. Termination
---------------
-
-5.1. The rights granted under this License will terminate automatically
-if You fail to comply with any of its terms. However, if You become
-compliant, then the rights granted under this License from a particular
-Contributor are reinstated (a) provisionally, unless and until such
-Contributor explicitly and finally terminates Your grants, and (b) on an
-ongoing basis, if such Contributor fails to notify You of the
-non-compliance by some reasonable means prior to 60 days after You have
-come back into compliance. Moreover, Your grants from a particular
-Contributor are reinstated on an ongoing basis if such Contributor
-notifies You of the non-compliance by some reasonable means, this is the
-first time You have received notice of non-compliance with this License
-from such Contributor, and You become compliant prior to 30 days after
-Your receipt of the notice.
-
-5.2. If You initiate litigation against any entity by asserting a patent
-infringement claim (excluding declaratory judgment actions,
-counter-claims, and cross-claims) alleging that a Contributor Version
-directly or indirectly infringes any patent, then the rights granted to
-You by any and all Contributors for the Covered Software under Section
-2.1 of this License shall terminate.
-
-5.3. In the event of termination under Sections 5.1 or 5.2 above, all
-end user license agreements (excluding distributors and resellers) which
-have been validly granted by You or Your distributors under this License
-prior to termination shall survive termination.
-
-************************************************************************
-* *
-* 6. Disclaimer of Warranty *
-* ------------------------- *
-* *
-* Covered Software is provided under this License on an "as is" *
-* basis, without warranty of any kind, either expressed, implied, or *
-* statutory, including, without limitation, warranties that the *
-* Covered Software is free of defects, merchantable, fit for a *
-* particular purpose or non-infringing. The entire risk as to the *
-* quality and performance of the Covered Software is with You. *
-* Should any Covered Software prove defective in any respect, You *
-* (not any Contributor) assume the cost of any necessary servicing, *
-* repair, or correction. This disclaimer of warranty constitutes an *
-* essential part of this License. No use of any Covered Software is *
-* authorized under this License except under this disclaimer. *
-* *
-************************************************************************
-
-************************************************************************
-* *
-* 7. Limitation of Liability *
-* -------------------------- *
-* *
-* Under no circumstances and under no legal theory, whether tort *
-* (including negligence), contract, or otherwise, shall any *
-* Contributor, or anyone who distributes Covered Software as *
-* permitted above, be liable to You for any direct, indirect, *
-* special, incidental, or consequential damages of any character *
-* including, without limitation, damages for lost profits, loss of *
-* goodwill, work stoppage, computer failure or malfunction, or any *
-* and all other commercial damages or losses, even if such party *
-* shall have been informed of the possibility of such damages. This *
-* limitation of liability shall not apply to liability for death or *
-* personal injury resulting from such party's negligence to the *
-* extent applicable law prohibits such limitation. Some *
-* jurisdictions do not allow the exclusion or limitation of *
-* incidental or consequential damages, so this exclusion and *
-* limitation may not apply to You. *
-* *
-************************************************************************
-
-8. Litigation
--------------
-
-Any litigation relating to this License may be brought only in the
-courts of a jurisdiction where the defendant maintains its principal
-place of business and such litigation shall be governed by laws of that
-jurisdiction, without reference to its conflict-of-law provisions.
-Nothing in this Section shall prevent a party's ability to bring
-cross-claims or counter-claims.
-
-9. Miscellaneous
-----------------
-
-This License represents the complete agreement concerning the subject
-matter hereof. If any provision of this License is held to be
-unenforceable, such provision shall be reformed only to the extent
-necessary to make it enforceable. Any law or regulation which provides
-that the language of a contract shall be construed against the drafter
-shall not be used to construe this License against a Contributor.
-
-10. Versions of the License
----------------------------
-
-10.1. New Versions
-
-Mozilla Foundation is the license steward. Except as provided in Section
-10.3, no one other than the license steward has the right to modify or
-publish new versions of this License. Each version will be given a
-distinguishing version number.
-
-10.2. Effect of New Versions
-
-You may distribute the Covered Software under the terms of the version
-of the License under which You originally received the Covered Software,
-or under the terms of any subsequent version published by the license
-steward.
-
-10.3. Modified Versions
-
-If you create software not governed by this License, and you want to
-create a new license for such software, you may create and use a
-modified version of this License if you rename the license and remove
-any references to the name of the license steward (except to note that
-such modified license differs from this License).
-
-10.4. Distributing Source Code Form that is Incompatible With Secondary
-Licenses
-
-If You choose to distribute Source Code Form that is Incompatible With
-Secondary Licenses under the terms of this version of the License, the
-notice described in Exhibit B of this License must be attached.
-
-Exhibit A - Source Code Form License Notice
--------------------------------------------
-
- This Source Code Form is subject to the terms of the Mozilla Public
- License, v. 2.0. If a copy of the MPL was not distributed with this
- file, You can obtain one at http://mozilla.org/MPL/2.0/.
-
-If it is not possible or desirable to put the notice in a particular
-file, then You may include the notice in a location (such as a LICENSE
-file in a relevant directory) where a recipient would be likely to look
-for such a notice.
-
-You may add additional accurate notices of copyright ownership.
-
-Exhibit B - "Incompatible With Secondary Licenses" Notice
----------------------------------------------------------
-
- This Source Code Form is "Incompatible With Secondary Licenses", as
- defined by the Mozilla Public License, v. 2.0.
-
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/AUTHORS.md b/vendor/github.com/tredoe/osutil/user/crypt/AUTHORS.md
deleted file mode 100644
index 8eb23dd..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/AUTHORS.md
+++ /dev/null
@@ -1,8 +0,0 @@
-### Initial author
-
-[Jeramey Crawford](https://github.com/jeramey)
-
-### Other authors
-
-[Jonas mg](https://github.com/tredoe)
-
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/LICENSE b/vendor/github.com/tredoe/osutil/user/crypt/LICENSE
deleted file mode 100644
index c39e0de..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2012, Jeramey Crawford
-Copyright (c) 2013, Jonas mg
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
- notice, this list of conditions and the following disclaimer.
-
- * Redistributions in binary form must reproduce the above copyright
- notice, this list of conditions and the following disclaimer in
- the documentation and/or other materials provided with the
- distribution.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/apr1_crypt/apr1_crypt.go b/vendor/github.com/tredoe/osutil/user/crypt/apr1_crypt/apr1_crypt.go
deleted file mode 100644
index bb36754..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/apr1_crypt/apr1_crypt.go
+++ /dev/null
@@ -1,62 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-// Package apr1_crypt implements the standard Unix MD5-crypt algorithm created
-// by Poul-Henning Kamp for FreeBSD, and modified by the Apache project.
-//
-// The only change from MD5-crypt is the use of the magic constant "$apr1$"
-// instead of "$1$". The algorithms are otherwise identical.
-package apr1_crypt
-
-import (
- "github.com/tredoe/osutil/user/crypt"
- "github.com/tredoe/osutil/user/crypt/common"
- "github.com/tredoe/osutil/user/crypt/md5_crypt"
-)
-
-func init() {
- crypt.RegisterCrypt(crypt.APR1, New, MagicPrefix)
-}
-
-const (
- MagicPrefix = "$apr1$"
- SaltLenMin = 1
- SaltLenMax = 8
- RoundsDefault = 1000
-)
-
-var md5Crypt = md5_crypt.New()
-
-func init() {
- md5Crypt.SetSalt(GetSalt())
-}
-
-type crypter struct{ Salt common.Salt }
-
-// New returns a new crypt.Crypter computing the variant "apr1" of MD5-crypt
-func New() crypt.Crypter { return &crypter{common.Salt{}} }
-
-func (c *crypter) Generate(key, salt []byte) (string, error) {
- return md5Crypt.Generate(key, salt)
-}
-
-func (c *crypter) Verify(hashedKey string, key []byte) error {
- return md5Crypt.Verify(hashedKey, key)
-}
-
-func (c *crypter) Cost(hashedKey string) (int, error) { return RoundsDefault, nil }
-
-func (c *crypter) SetSalt(salt common.Salt) {}
-
-func GetSalt() common.Salt {
- return common.Salt{
- MagicPrefix: []byte(MagicPrefix),
- SaltLenMin: SaltLenMin,
- SaltLenMax: SaltLenMax,
- RoundsDefault: RoundsDefault,
- }
-}
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/common/base64.go b/vendor/github.com/tredoe/osutil/user/crypt/common/base64.go
deleted file mode 100644
index ed057d5..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/common/base64.go
+++ /dev/null
@@ -1,60 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-package common
-
-const alphabet = "./0123456789ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz"
-
-// Base64_24Bit is a variant of Base64 encoding, commonly used with password
-// hashing algorithms to encode the result of their checksum output.
-//
-// The algorithm operates on up to 3 bytes at a time, encoding the following
-// 6-bit sequences into up to 4 hash64 ASCII bytes.
-//
-// 1. Bottom 6 bits of the first byte
-// 2. Top 2 bits of the first byte, and bottom 4 bits of the second byte.
-// 3. Top 4 bits of the second byte, and bottom 2 bits of the third byte.
-// 4. Top 6 bits of the third byte.
-//
-// This encoding method does not emit padding bytes as Base64 does.
-func Base64_24Bit(src []byte) (hash []byte) {
- if len(src) == 0 {
- return []byte{} // TODO: return nil
- }
-
- hashSize := (len(src) * 8) / 6
- if (len(src) % 6) != 0 {
- hashSize += 1
- }
- hash = make([]byte, hashSize)
-
- dst := hash
- for len(src) > 0 {
- switch len(src) {
- default:
- dst[0] = alphabet[src[0]&0x3f]
- dst[1] = alphabet[((src[0]>>6)|(src[1]<<2))&0x3f]
- dst[2] = alphabet[((src[1]>>4)|(src[2]<<4))&0x3f]
- dst[3] = alphabet[(src[2]>>2)&0x3f]
- src = src[3:]
- dst = dst[4:]
- case 2:
- dst[0] = alphabet[src[0]&0x3f]
- dst[1] = alphabet[((src[0]>>6)|(src[1]<<2))&0x3f]
- dst[2] = alphabet[(src[1]>>4)&0x3f]
- src = src[2:]
- dst = dst[3:]
- case 1:
- dst[0] = alphabet[src[0]&0x3f]
- dst[1] = alphabet[(src[0]>>6)&0x3f]
- src = src[1:]
- dst = dst[2:]
- }
- }
-
- return
-}
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/common/doc.go b/vendor/github.com/tredoe/osutil/user/crypt/common/doc.go
deleted file mode 100644
index 8eb6aff..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/common/doc.go
+++ /dev/null
@@ -1,13 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-// Package common contains routines used by multiple password hashing
-// algorithms.
-//
-// Generally, you will never import this package directly. Many of the
-// *_crypt packages will import this package if they require it.
-package common
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/common/salt.go b/vendor/github.com/tredoe/osutil/user/crypt/common/salt.go
deleted file mode 100644
index 22f51cc..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/common/salt.go
+++ /dev/null
@@ -1,105 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-package common
-
-import (
- "crypto/rand"
- "errors"
- "strconv"
-)
-
-var (
- ErrSaltPrefix = errors.New("invalid magic prefix")
- ErrSaltFormat = errors.New("invalid salt format")
- ErrSaltRounds = errors.New("invalid rounds")
-)
-
-// Salt represents a salt.
-type Salt struct {
- MagicPrefix []byte
-
- SaltLenMin int
- SaltLenMax int
-
- RoundsMin int
- RoundsMax int
- RoundsDefault int
-}
-
-// Generate generates a random salt of a given length.
-//
-// The length is set thus:
-//
-// length > SaltLenMax: length = SaltLenMax
-// length < SaltLenMin: length = SaltLenMin
-func (s *Salt) Generate(length int) []byte {
- if length > s.SaltLenMax {
- length = s.SaltLenMax
- } else if length < s.SaltLenMin {
- length = s.SaltLenMin
- }
-
- saltLen := (length * 6 / 8)
- if (length*6)%8 != 0 {
- saltLen += 1
- }
- salt := make([]byte, saltLen)
- rand.Read(salt)
-
- out := make([]byte, len(s.MagicPrefix)+length)
- copy(out, s.MagicPrefix)
- copy(out[len(s.MagicPrefix):], Base64_24Bit(salt))
- return out
-}
-
-// GenerateWRounds creates a random salt with the random bytes being of the
-// length provided, and the rounds parameter set as specified.
-//
-// The parameters are set thus:
-//
-// length > SaltLenMax: length = SaltLenMax
-// length < SaltLenMin: length = SaltLenMin
-//
-// rounds < 0: rounds = RoundsDefault
-// rounds < RoundsMin: rounds = RoundsMin
-// rounds > RoundsMax: rounds = RoundsMax
-//
-// If rounds is equal to RoundsDefault, then the "rounds=" part of the salt is
-// removed.
-func (s *Salt) GenerateWRounds(length, rounds int) []byte {
- if length > s.SaltLenMax {
- length = s.SaltLenMax
- } else if length < s.SaltLenMin {
- length = s.SaltLenMin
- }
- if rounds < 0 {
- rounds = s.RoundsDefault
- } else if rounds < s.RoundsMin {
- rounds = s.RoundsMin
- } else if rounds > s.RoundsMax {
- rounds = s.RoundsMax
- }
-
- saltLen := (length * 6 / 8)
- if (length*6)%8 != 0 {
- saltLen += 1
- }
- salt := make([]byte, saltLen)
- rand.Read(salt)
-
- roundsText := ""
- if rounds != s.RoundsDefault {
- roundsText = "rounds=" + strconv.Itoa(rounds)
- }
-
- out := make([]byte, len(s.MagicPrefix)+len(roundsText)+length)
- copy(out, s.MagicPrefix)
- copy(out[len(s.MagicPrefix):], []byte(roundsText))
- copy(out[len(s.MagicPrefix)+len(roundsText):], Base64_24Bit(salt))
- return out
-}
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/crypt.go b/vendor/github.com/tredoe/osutil/user/crypt/crypt.go
deleted file mode 100644
index 5ded2da..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/crypt.go
+++ /dev/null
@@ -1,108 +0,0 @@
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-// Package crypt provides interface for password crypt functions and collects
-// common constants.
-package crypt
-
-import (
- "errors"
- "strings"
-
- "github.com/tredoe/osutil/user/crypt/common"
-)
-
-var ErrKeyMismatch = errors.New("hashed value is not the hash of the given password")
-
-// Crypter is the common interface implemented by all crypt functions.
-type Crypter interface {
- // Generate performs the hashing algorithm, returning a full hash suitable
- // for storage and later password verification.
- //
- // If the salt is empty, a randomly-generated salt will be generated with a
- // length of SaltLenMax and number RoundsDefault of rounds.
- //
- // Any error only can be got when the salt argument is not empty.
- Generate(key, salt []byte) (string, error)
-
- // Verify compares a hashed key with its possible key equivalent.
- // Returns nil on success, or an error on failure; if the hashed key is
- // diffrent, the error is "ErrKeyMismatch".
- Verify(hashedKey string, key []byte) error
-
- // Cost returns the hashing cost (in rounds) used to create the given hashed
- // key.
- //
- // When, in the future, the hashing cost of a key needs to be increased in
- // order to adjust for greater computational power, this function allows one
- // to establish which keys need to be updated.
- //
- // The algorithms based in MD5-crypt use a fixed value of rounds.
- Cost(hashedKey string) (int, error)
-
- // SetSalt sets a different salt. It is used to easily create derivated
- // algorithms, i.e. "apr1_crypt" from "md5_crypt".
- SetSalt(salt common.Salt)
-}
-
-// Crypt identifies a crypt function that is implemented in another package.
-type Crypt uint
-
-const (
- APR1 Crypt = iota + 1 // import "github.com/tredoe/osutil/user/crypt/apr1_crypt"
- MD5 // import "github.com/tredoe/osutil/user/crypt/md5_crypt"
- SHA256 // import "github.com/tredoe/osutil/user/crypt/sha256_crypt"
- SHA512 // import "github.com/tredoe/osutil/user/crypt/sha512_crypt"
- maxCrypt
-)
-
-var cryptPrefixes = make([]string, maxCrypt)
-
-var crypts = make([]func() Crypter, maxCrypt)
-
-// RegisterCrypt registers a function that returns a new instance of the given
-// crypt function. This is intended to be called from the init function in
-// packages that implement crypt functions.
-func RegisterCrypt(c Crypt, f func() Crypter, prefix string) {
- if c >= maxCrypt {
- panic("crypt: RegisterHash of unknown crypt function")
- }
- crypts[c] = f
- cryptPrefixes[c] = prefix
-}
-
-// New returns a new crypter.
-func New(c Crypt) Crypter {
- f := crypts[c]
- if f != nil {
- return f()
- }
- panic("crypt: requested crypt function is unavailable")
-}
-
-// NewFromHash returns a new Crypter using the prefix in the given hashed key.
-func NewFromHash(hashedKey string) Crypter {
- var f func() Crypter
-
- if strings.HasPrefix(hashedKey, cryptPrefixes[SHA512]) {
- f = crypts[SHA512]
- } else if strings.HasPrefix(hashedKey, cryptPrefixes[SHA256]) {
- f = crypts[SHA256]
- } else if strings.HasPrefix(hashedKey, cryptPrefixes[MD5]) {
- f = crypts[MD5]
- } else if strings.HasPrefix(hashedKey, cryptPrefixes[APR1]) {
- f = crypts[APR1]
- } else {
- toks := strings.SplitN(hashedKey, "$", 3)
- prefix := "$" + toks[1] + "$"
- panic("crypt: unknown cryp function from prefix: " + prefix)
- }
-
- if f != nil {
- return f()
- }
- panic("crypt: requested cryp function is unavailable")
-}
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/md5_crypt/md5_crypt.go b/vendor/github.com/tredoe/osutil/user/crypt/md5_crypt/md5_crypt.go
deleted file mode 100644
index 33091c8..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/md5_crypt/md5_crypt.go
+++ /dev/null
@@ -1,166 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-// Package md5_crypt implements the standard Unix MD5-crypt algorithm created by
-// Poul-Henning Kamp for FreeBSD.
-package md5_crypt
-
-import (
- "bytes"
- "crypto/md5"
-
- "github.com/tredoe/osutil/user/crypt"
- "github.com/tredoe/osutil/user/crypt/common"
-)
-
-func init() {
- crypt.RegisterCrypt(crypt.MD5, New, MagicPrefix)
-}
-
-// NOTE: Cisco IOS only allows salts of length 4.
-
-const (
- MagicPrefix = "$1$"
- SaltLenMin = 1 // Real minimum is 0, but that isn't useful.
- SaltLenMax = 8
- RoundsDefault = 1000
-)
-
-type crypter struct{ Salt common.Salt }
-
-// New returns a new crypt.Crypter computing the MD5-crypt password hashing.
-func New() crypt.Crypter {
- return &crypter{GetSalt()}
-}
-
-func (c *crypter) Generate(key, salt []byte) (string, error) {
- if len(salt) == 0 {
- salt = c.Salt.Generate(SaltLenMax)
- }
- if !bytes.HasPrefix(salt, c.Salt.MagicPrefix) {
- return "", common.ErrSaltPrefix
- }
-
- saltToks := bytes.Split(salt, []byte{'$'})
-
- if len(saltToks) < 3 {
- return "", common.ErrSaltFormat
- } else {
- salt = saltToks[2]
- }
- if len(salt) > 8 {
- salt = salt[0:8]
- }
-
- // Compute alternate MD5 sum with input KEY, SALT, and KEY.
- Alternate := md5.New()
- Alternate.Write(key)
- Alternate.Write(salt)
- Alternate.Write(key)
- AlternateSum := Alternate.Sum(nil) // 16 bytes
-
- A := md5.New()
- A.Write(key)
- A.Write(c.Salt.MagicPrefix)
- A.Write(salt)
- // Add for any character in the key one byte of the alternate sum.
- i := len(key)
- for ; i > 16; i -= 16 {
- A.Write(AlternateSum)
- }
- A.Write(AlternateSum[0:i])
-
- // The original implementation now does something weird:
- // For every 1 bit in the key, the first 0 is added to the buffer
- // For every 0 bit, the first character of the key
- // This does not seem to be what was intended but we have to follow this to
- // be compatible.
- for i = len(key); i > 0; i >>= 1 {
- if (i & 1) == 0 {
- A.Write(key[0:1])
- } else {
- A.Write([]byte{0})
- }
- }
- Csum := A.Sum(nil)
-
- // In fear of password crackers here comes a quite long loop which just
- // processes the output of the previous round again.
- // We cannot ignore this here.
- for i = 0; i < RoundsDefault; i++ {
- C := md5.New()
-
- // Add key or last result.
- if (i & 1) != 0 {
- C.Write(key)
- } else {
- C.Write(Csum)
- }
- // Add salt for numbers not divisible by 3.
- if (i % 3) != 0 {
- C.Write(salt)
- }
- // Add key for numbers not divisible by 7.
- if (i % 7) != 0 {
- C.Write(key)
- }
- // Add key or last result.
- if (i & 1) == 0 {
- C.Write(key)
- } else {
- C.Write(Csum)
- }
-
- Csum = C.Sum(nil)
- }
-
- out := make([]byte, 0, 23+len(c.Salt.MagicPrefix)+len(salt))
- out = append(out, c.Salt.MagicPrefix...)
- out = append(out, salt...)
- out = append(out, '$')
- out = append(out, common.Base64_24Bit([]byte{
- Csum[12], Csum[6], Csum[0],
- Csum[13], Csum[7], Csum[1],
- Csum[14], Csum[8], Csum[2],
- Csum[15], Csum[9], Csum[3],
- Csum[5], Csum[10], Csum[4],
- Csum[11],
- })...)
-
- // Clean sensitive data.
- A.Reset()
- Alternate.Reset()
- for i = 0; i < len(AlternateSum); i++ {
- AlternateSum[i] = 0
- }
-
- return string(out), nil
-}
-
-func (c *crypter) Verify(hashedKey string, key []byte) error {
- newHash, err := c.Generate(key, []byte(hashedKey))
- if err != nil {
- return err
- }
- if newHash != hashedKey {
- return crypt.ErrKeyMismatch
- }
- return nil
-}
-
-func (c *crypter) Cost(hashedKey string) (int, error) { return RoundsDefault, nil }
-
-func (c *crypter) SetSalt(salt common.Salt) { c.Salt = salt }
-
-func GetSalt() common.Salt {
- return common.Salt{
- MagicPrefix: []byte(MagicPrefix),
- SaltLenMin: SaltLenMin,
- SaltLenMax: SaltLenMax,
- RoundsDefault: RoundsDefault,
- }
-}
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/sha256_crypt/sha256_crypt.go b/vendor/github.com/tredoe/osutil/user/crypt/sha256_crypt/sha256_crypt.go
deleted file mode 100644
index fe30746..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/sha256_crypt/sha256_crypt.go
+++ /dev/null
@@ -1,243 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-// Package sha256_crypt implements Ulrich Drepper's SHA256-crypt password
-// hashing algorithm.
-//
-// The specification for this algorithm can be found here:
-// http://www.akkadia.org/drepper/SHA-crypt.txt
-package sha256_crypt
-
-import (
- "bytes"
- "crypto/sha256"
- "strconv"
-
- "github.com/tredoe/osutil/user/crypt"
- "github.com/tredoe/osutil/user/crypt/common"
-)
-
-func init() {
- crypt.RegisterCrypt(crypt.SHA256, New, MagicPrefix)
-}
-
-const (
- MagicPrefix = "$5$"
- SaltLenMin = 1
- SaltLenMax = 16
- RoundsMin = 1000
- RoundsMax = 999999999
- RoundsDefault = 5000
-)
-
-var _rounds = []byte("rounds=")
-
-type crypter struct{ Salt common.Salt }
-
-// New returns a new crypt.Crypter computing the SHA256-crypt password hashing.
-func New() crypt.Crypter {
- return &crypter{GetSalt()}
-}
-
-func (c *crypter) Generate(key, salt []byte) (string, error) {
- var rounds int
- var isRoundsDef bool
-
- if len(salt) == 0 {
- salt = c.Salt.GenerateWRounds(SaltLenMax, RoundsDefault)
- }
- if !bytes.HasPrefix(salt, c.Salt.MagicPrefix) {
- return "", common.ErrSaltPrefix
- }
-
- saltToks := bytes.Split(salt, []byte{'$'})
- if len(saltToks) < 3 {
- return "", common.ErrSaltFormat
- }
-
- if bytes.HasPrefix(saltToks[2], _rounds) {
- isRoundsDef = true
- pr, err := strconv.ParseInt(string(saltToks[2][7:]), 10, 32)
- if err != nil {
- return "", common.ErrSaltRounds
- }
- rounds = int(pr)
- if rounds < RoundsMin {
- rounds = RoundsMin
- } else if rounds > RoundsMax {
- rounds = RoundsMax
- }
- salt = saltToks[3]
- } else {
- rounds = RoundsDefault
- salt = saltToks[2]
- }
-
- if len(salt) > 16 {
- salt = salt[0:16]
- }
-
- // Compute alternate SHA256 sum with input KEY, SALT, and KEY.
- Alternate := sha256.New()
- Alternate.Write(key)
- Alternate.Write(salt)
- Alternate.Write(key)
- AlternateSum := Alternate.Sum(nil) // 32 bytes
-
- A := sha256.New()
- A.Write(key)
- A.Write(salt)
- // Add for any character in the key one byte of the alternate sum.
- i := len(key)
- for ; i > 32; i -= 32 {
- A.Write(AlternateSum)
- }
- A.Write(AlternateSum[0:i])
-
- // Take the binary representation of the length of the key and for every add
- // the alternate sum, for every 0 the key.
- for i = len(key); i > 0; i >>= 1 {
- if (i & 1) != 0 {
- A.Write(AlternateSum)
- } else {
- A.Write(key)
- }
- }
- Asum := A.Sum(nil)
-
- // Start computation of P byte sequence.
- P := sha256.New()
- // For every character in the password add the entire password.
- for i = 0; i < len(key); i++ {
- P.Write(key)
- }
- Psum := P.Sum(nil)
- // Create byte sequence P.
- Pseq := make([]byte, 0, len(key))
- for i = len(key); i > 32; i -= 32 {
- Pseq = append(Pseq, Psum...)
- }
- Pseq = append(Pseq, Psum[0:i]...)
-
- // Start computation of S byte sequence.
- S := sha256.New()
- for i = 0; i < (16 + int(Asum[0])); i++ {
- S.Write(salt)
- }
- Ssum := S.Sum(nil)
- // Create byte sequence S.
- Sseq := make([]byte, 0, len(salt))
- for i = len(salt); i > 32; i -= 32 {
- Sseq = append(Sseq, Ssum...)
- }
- Sseq = append(Sseq, Ssum[0:i]...)
-
- Csum := Asum
-
- // Repeatedly run the collected hash value through SHA256 to burn CPU cycles.
- for i = 0; i < rounds; i++ {
- C := sha256.New()
-
- // Add key or last result.
- if (i & 1) != 0 {
- C.Write(Pseq)
- } else {
- C.Write(Csum)
- }
- // Add salt for numbers not divisible by 3.
- if (i % 3) != 0 {
- C.Write(Sseq)
- }
- // Add key for numbers not divisible by 7.
- if (i % 7) != 0 {
- C.Write(Pseq)
- }
- // Add key or last result.
- if (i & 1) != 0 {
- C.Write(Csum)
- } else {
- C.Write(Pseq)
- }
-
- Csum = C.Sum(nil)
- }
-
- out := make([]byte, 0, 80)
- out = append(out, c.Salt.MagicPrefix...)
- if isRoundsDef {
- out = append(out, []byte("rounds="+strconv.Itoa(rounds)+"$")...)
- }
- out = append(out, salt...)
- out = append(out, '$')
- out = append(out, common.Base64_24Bit([]byte{
- Csum[20], Csum[10], Csum[0],
- Csum[11], Csum[1], Csum[21],
- Csum[2], Csum[22], Csum[12],
- Csum[23], Csum[13], Csum[3],
- Csum[14], Csum[4], Csum[24],
- Csum[5], Csum[25], Csum[15],
- Csum[26], Csum[16], Csum[6],
- Csum[17], Csum[7], Csum[27],
- Csum[8], Csum[28], Csum[18],
- Csum[29], Csum[19], Csum[9],
- Csum[30], Csum[31],
- })...)
-
- // Clean sensitive data.
- A.Reset()
- Alternate.Reset()
- P.Reset()
- for i = 0; i < len(Asum); i++ {
- Asum[i] = 0
- }
- for i = 0; i < len(AlternateSum); i++ {
- AlternateSum[i] = 0
- }
- for i = 0; i < len(Pseq); i++ {
- Pseq[i] = 0
- }
-
- return string(out), nil
-}
-
-func (c *crypter) Verify(hashedKey string, key []byte) error {
- newHash, err := c.Generate(key, []byte(hashedKey))
- if err != nil {
- return err
- }
- if newHash != hashedKey {
- return crypt.ErrKeyMismatch
- }
- return nil
-}
-
-func (c *crypter) Cost(hashedKey string) (int, error) {
- saltToks := bytes.Split([]byte(hashedKey), []byte{'$'})
- if len(saltToks) < 3 {
- return 0, common.ErrSaltFormat
- }
-
- if !bytes.HasPrefix(saltToks[2], _rounds) {
- return RoundsDefault, nil
- }
- roundToks := bytes.Split(saltToks[2], []byte{'='})
- cost, err := strconv.ParseInt(string(roundToks[1]), 10, 0)
- return int(cost), err
-}
-
-func (c *crypter) SetSalt(salt common.Salt) { c.Salt = salt }
-
-func GetSalt() common.Salt {
- return common.Salt{
- MagicPrefix: []byte(MagicPrefix),
- SaltLenMin: SaltLenMin,
- SaltLenMax: SaltLenMax,
- RoundsDefault: RoundsDefault,
- RoundsMin: RoundsMin,
- RoundsMax: RoundsMax,
- }
-}
diff --git a/vendor/github.com/tredoe/osutil/user/crypt/sha512_crypt/sha512_crypt.go b/vendor/github.com/tredoe/osutil/user/crypt/sha512_crypt/sha512_crypt.go
deleted file mode 100644
index fd55e88..0000000
--- a/vendor/github.com/tredoe/osutil/user/crypt/sha512_crypt/sha512_crypt.go
+++ /dev/null
@@ -1,254 +0,0 @@
-// Copyright 2012, Jeramey Crawford
-// Copyright 2013, Jonas mg
-// All rights reserved.
-//
-// Use of this source code is governed by a BSD-style license
-// that can be found in the LICENSE file.
-
-// Package sha512_crypt implements Ulrich Drepper's SHA512-crypt password
-// hashing algorithm.
-//
-// The specification for this algorithm can be found here:
-// http://www.akkadia.org/drepper/SHA-crypt.txt
-package sha512_crypt
-
-import (
- "bytes"
- "crypto/sha512"
- "strconv"
-
- "github.com/tredoe/osutil/user/crypt"
- "github.com/tredoe/osutil/user/crypt/common"
-)
-
-func init() {
- crypt.RegisterCrypt(crypt.SHA512, New, MagicPrefix)
-}
-
-const (
- MagicPrefix = "$6$"
- SaltLenMin = 1
- SaltLenMax = 16
- RoundsMin = 1000
- RoundsMax = 999999999
- RoundsDefault = 5000
-)
-
-var _rounds = []byte("rounds=")
-
-type crypter struct{ Salt common.Salt }
-
-// New returns a new crypt.Crypter computing the SHA512-crypt password hashing.
-func New() crypt.Crypter {
- return &crypter{GetSalt()}
-}
-
-func (c *crypter) Generate(key, salt []byte) (string, error) {
- var rounds int
- var isRoundsDef bool
-
- if len(salt) == 0 {
- salt = c.Salt.GenerateWRounds(SaltLenMax, RoundsDefault)
- }
- if !bytes.HasPrefix(salt, c.Salt.MagicPrefix) {
- return "", common.ErrSaltPrefix
- }
-
- saltToks := bytes.Split(salt, []byte{'$'})
- if len(saltToks) < 3 {
- return "", common.ErrSaltFormat
- }
-
- if bytes.HasPrefix(saltToks[2], _rounds) {
- isRoundsDef = true
- pr, err := strconv.ParseInt(string(saltToks[2][7:]), 10, 32)
- if err != nil {
- return "", common.ErrSaltRounds
- }
- rounds = int(pr)
- if rounds < RoundsMin {
- rounds = RoundsMin
- } else if rounds > RoundsMax {
- rounds = RoundsMax
- }
- salt = saltToks[3]
- } else {
- rounds = RoundsDefault
- salt = saltToks[2]
- }
-
- if len(salt) > SaltLenMax {
- salt = salt[0:SaltLenMax]
- }
-
- // Compute alternate SHA512 sum with input KEY, SALT, and KEY.
- Alternate := sha512.New()
- Alternate.Write(key)
- Alternate.Write(salt)
- Alternate.Write(key)
- AlternateSum := Alternate.Sum(nil) // 64 bytes
-
- A := sha512.New()
- A.Write(key)
- A.Write(salt)
- // Add for any character in the key one byte of the alternate sum.
- i := len(key)
- for ; i > 64; i -= 64 {
- A.Write(AlternateSum)
- }
- A.Write(AlternateSum[0:i])
-
- // Take the binary representation of the length of the key and for every add
- // the alternate sum, for every 0 the key.
- for i = len(key); i > 0; i >>= 1 {
- if (i & 1) != 0 {
- A.Write(AlternateSum)
- } else {
- A.Write(key)
- }
- }
- Asum := A.Sum(nil)
-
- // Start computation of P byte sequence.
- P := sha512.New()
- // For every character in the password add the entire password.
- for i = 0; i < len(key); i++ {
- P.Write(key)
- }
- Psum := P.Sum(nil)
- // Create byte sequence P.
- Pseq := make([]byte, 0, len(key))
- for i = len(key); i > 64; i -= 64 {
- Pseq = append(Pseq, Psum...)
- }
- Pseq = append(Pseq, Psum[0:i]...)
-
- // Start computation of S byte sequence.
- S := sha512.New()
- for i = 0; i < (16 + int(Asum[0])); i++ {
- S.Write(salt)
- }
- Ssum := S.Sum(nil)
- // Create byte sequence S.
- Sseq := make([]byte, 0, len(salt))
- for i = len(salt); i > 64; i -= 64 {
- Sseq = append(Sseq, Ssum...)
- }
- Sseq = append(Sseq, Ssum[0:i]...)
-
- Csum := Asum
-
- // Repeatedly run the collected hash value through SHA512 to burn CPU cycles.
- for i = 0; i < rounds; i++ {
- C := sha512.New()
-
- // Add key or last result.
- if (i & 1) != 0 {
- C.Write(Pseq)
- } else {
- C.Write(Csum)
- }
- // Add salt for numbers not divisible by 3.
- if (i % 3) != 0 {
- C.Write(Sseq)
- }
- // Add key for numbers not divisible by 7.
- if (i % 7) != 0 {
- C.Write(Pseq)
- }
- // Add key or last result.
- if (i & 1) != 0 {
- C.Write(Csum)
- } else {
- C.Write(Pseq)
- }
-
- Csum = C.Sum(nil)
- }
-
- out := make([]byte, 0, 123)
- out = append(out, c.Salt.MagicPrefix...)
- if isRoundsDef {
- out = append(out, []byte("rounds="+strconv.Itoa(rounds)+"$")...)
- }
- out = append(out, salt...)
- out = append(out, '$')
- out = append(out, common.Base64_24Bit([]byte{
- Csum[42], Csum[21], Csum[0],
- Csum[1], Csum[43], Csum[22],
- Csum[23], Csum[2], Csum[44],
- Csum[45], Csum[24], Csum[3],
- Csum[4], Csum[46], Csum[25],
- Csum[26], Csum[5], Csum[47],
- Csum[48], Csum[27], Csum[6],
- Csum[7], Csum[49], Csum[28],
- Csum[29], Csum[8], Csum[50],
- Csum[51], Csum[30], Csum[9],
- Csum[10], Csum[52], Csum[31],
- Csum[32], Csum[11], Csum[53],
- Csum[54], Csum[33], Csum[12],
- Csum[13], Csum[55], Csum[34],
- Csum[35], Csum[14], Csum[56],
- Csum[57], Csum[36], Csum[15],
- Csum[16], Csum[58], Csum[37],
- Csum[38], Csum[17], Csum[59],
- Csum[60], Csum[39], Csum[18],
- Csum[19], Csum[61], Csum[40],
- Csum[41], Csum[20], Csum[62],
- Csum[63],
- })...)
-
- // Clean sensitive data.
- A.Reset()
- Alternate.Reset()
- P.Reset()
- for i = 0; i < len(Asum); i++ {
- Asum[i] = 0
- }
- for i = 0; i < len(AlternateSum); i++ {
- AlternateSum[i] = 0
- }
- for i = 0; i < len(Pseq); i++ {
- Pseq[i] = 0
- }
-
- return string(out), nil
-}
-
-func (c *crypter) Verify(hashedKey string, key []byte) error {
- newHash, err := c.Generate(key, []byte(hashedKey))
- if err != nil {
- return err
- }
- if newHash != hashedKey {
- return crypt.ErrKeyMismatch
- }
- return nil
-}
-
-func (c *crypter) Cost(hashedKey string) (int, error) {
- saltToks := bytes.Split([]byte(hashedKey), []byte{'$'})
- if len(saltToks) < 3 {
- return 0, common.ErrSaltFormat
- }
-
- if !bytes.HasPrefix(saltToks[2], _rounds) {
- return RoundsDefault, nil
- }
- roundToks := bytes.Split(saltToks[2], []byte{'='})
- cost, err := strconv.ParseInt(string(roundToks[1]), 10, 0)
- return int(cost), err
-}
-
-func (c *crypter) SetSalt(salt common.Salt) { c.Salt = salt }
-
-func GetSalt() common.Salt {
- return common.Salt{
- MagicPrefix: []byte(MagicPrefix),
- SaltLenMin: SaltLenMin,
- SaltLenMax: SaltLenMax,
- RoundsDefault: RoundsDefault,
- RoundsMin: RoundsMin,
- RoundsMax: RoundsMax,
- }
-}
diff --git a/vendor/golang.org/x/crypto/AUTHORS b/vendor/golang.org/x/crypto/AUTHORS
deleted file mode 100644
index 2b00ddb..0000000
--- a/vendor/golang.org/x/crypto/AUTHORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code refers to The Go Authors for copyright purposes.
-# The master list of authors is in the main Go distribution,
-# visible at https://tip.golang.org/AUTHORS.
diff --git a/vendor/golang.org/x/crypto/CONTRIBUTORS b/vendor/golang.org/x/crypto/CONTRIBUTORS
deleted file mode 100644
index 1fbd3e9..0000000
--- a/vendor/golang.org/x/crypto/CONTRIBUTORS
+++ /dev/null
@@ -1,3 +0,0 @@
-# This source code was written by the Go contributors.
-# The master list of contributors is in the main Go distribution,
-# visible at https://tip.golang.org/CONTRIBUTORS.
diff --git a/vendor/golang.org/x/crypto/LICENSE b/vendor/golang.org/x/crypto/LICENSE
deleted file mode 100644
index 6a66aea..0000000
--- a/vendor/golang.org/x/crypto/LICENSE
+++ /dev/null
@@ -1,27 +0,0 @@
-Copyright (c) 2009 The Go Authors. All rights reserved.
-
-Redistribution and use in source and binary forms, with or without
-modification, are permitted provided that the following conditions are
-met:
-
- * Redistributions of source code must retain the above copyright
-notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above
-copyright notice, this list of conditions and the following disclaimer
-in the documentation and/or other materials provided with the
-distribution.
- * Neither the name of Google Inc. nor the names of its
-contributors may be used to endorse or promote products derived from
-this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
-"AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
-LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
-A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
-OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
-SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
-LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
-DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
-THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
-(INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
-OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
diff --git a/vendor/golang.org/x/crypto/PATENTS b/vendor/golang.org/x/crypto/PATENTS
deleted file mode 100644
index 7330990..0000000
--- a/vendor/golang.org/x/crypto/PATENTS
+++ /dev/null
@@ -1,22 +0,0 @@
-Additional IP Rights Grant (Patents)
-
-"This implementation" means the copyrightable works distributed by
-Google as part of the Go project.
-
-Google hereby grants to You a perpetual, worldwide, non-exclusive,
-no-charge, royalty-free, irrevocable (except as stated in this section)
-patent license to make, have made, use, offer to sell, sell, import,
-transfer and otherwise run, modify and propagate the contents of this
-implementation of Go, where such license applies only to those patent
-claims, both currently owned or controlled by Google and acquired in
-the future, licensable by Google that are necessarily infringed by this
-implementation of Go. This grant does not include claims that would be
-infringed only as a consequence of further modification of this
-implementation. If you or your agent or exclusive licensee institute or
-order or agree to the institution of patent litigation against any
-entity (including a cross-claim or counterclaim in a lawsuit) alleging
-that this implementation of Go or any code incorporated within this
-implementation of Go constitutes direct or contributory patent
-infringement, or inducement of patent infringement, then any patent
-rights granted to you under this License for this implementation of Go
-shall terminate as of the date such litigation is filed.
diff --git a/vendor/golang.org/x/crypto/bcrypt/base64.go b/vendor/golang.org/x/crypto/bcrypt/base64.go
deleted file mode 100644
index fc31160..0000000
--- a/vendor/golang.org/x/crypto/bcrypt/base64.go
+++ /dev/null
@@ -1,35 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package bcrypt
-
-import "encoding/base64"
-
-const alphabet = "./ABCDEFGHIJKLMNOPQRSTUVWXYZabcdefghijklmnopqrstuvwxyz0123456789"
-
-var bcEncoding = base64.NewEncoding(alphabet)
-
-func base64Encode(src []byte) []byte {
- n := bcEncoding.EncodedLen(len(src))
- dst := make([]byte, n)
- bcEncoding.Encode(dst, src)
- for dst[n-1] == '=' {
- n--
- }
- return dst[:n]
-}
-
-func base64Decode(src []byte) ([]byte, error) {
- numOfEquals := 4 - (len(src) % 4)
- for i := 0; i < numOfEquals; i++ {
- src = append(src, '=')
- }
-
- dst := make([]byte, bcEncoding.DecodedLen(len(src)))
- n, err := bcEncoding.Decode(dst, src)
- if err != nil {
- return nil, err
- }
- return dst[:n], nil
-}
diff --git a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go b/vendor/golang.org/x/crypto/bcrypt/bcrypt.go
deleted file mode 100644
index aeb73f8..0000000
--- a/vendor/golang.org/x/crypto/bcrypt/bcrypt.go
+++ /dev/null
@@ -1,295 +0,0 @@
-// Copyright 2011 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package bcrypt implements Provos and Mazières's bcrypt adaptive hashing
-// algorithm. See http://www.usenix.org/event/usenix99/provos/provos.pdf
-package bcrypt // import "golang.org/x/crypto/bcrypt"
-
-// The code is a port of Provos and Mazières's C implementation.
-import (
- "crypto/rand"
- "crypto/subtle"
- "errors"
- "fmt"
- "io"
- "strconv"
-
- "golang.org/x/crypto/blowfish"
-)
-
-const (
- MinCost int = 4 // the minimum allowable cost as passed in to GenerateFromPassword
- MaxCost int = 31 // the maximum allowable cost as passed in to GenerateFromPassword
- DefaultCost int = 10 // the cost that will actually be set if a cost below MinCost is passed into GenerateFromPassword
-)
-
-// The error returned from CompareHashAndPassword when a password and hash do
-// not match.
-var ErrMismatchedHashAndPassword = errors.New("crypto/bcrypt: hashedPassword is not the hash of the given password")
-
-// The error returned from CompareHashAndPassword when a hash is too short to
-// be a bcrypt hash.
-var ErrHashTooShort = errors.New("crypto/bcrypt: hashedSecret too short to be a bcrypted password")
-
-// The error returned from CompareHashAndPassword when a hash was created with
-// a bcrypt algorithm newer than this implementation.
-type HashVersionTooNewError byte
-
-func (hv HashVersionTooNewError) Error() string {
- return fmt.Sprintf("crypto/bcrypt: bcrypt algorithm version '%c' requested is newer than current version '%c'", byte(hv), majorVersion)
-}
-
-// The error returned from CompareHashAndPassword when a hash starts with something other than '$'
-type InvalidHashPrefixError byte
-
-func (ih InvalidHashPrefixError) Error() string {
- return fmt.Sprintf("crypto/bcrypt: bcrypt hashes must start with '$', but hashedSecret started with '%c'", byte(ih))
-}
-
-type InvalidCostError int
-
-func (ic InvalidCostError) Error() string {
- return fmt.Sprintf("crypto/bcrypt: cost %d is outside allowed range (%d,%d)", int(ic), int(MinCost), int(MaxCost))
-}
-
-const (
- majorVersion = '2'
- minorVersion = 'a'
- maxSaltSize = 16
- maxCryptedHashSize = 23
- encodedSaltSize = 22
- encodedHashSize = 31
- minHashSize = 59
-)
-
-// magicCipherData is an IV for the 64 Blowfish encryption calls in
-// bcrypt(). It's the string "OrpheanBeholderScryDoubt" in big-endian bytes.
-var magicCipherData = []byte{
- 0x4f, 0x72, 0x70, 0x68,
- 0x65, 0x61, 0x6e, 0x42,
- 0x65, 0x68, 0x6f, 0x6c,
- 0x64, 0x65, 0x72, 0x53,
- 0x63, 0x72, 0x79, 0x44,
- 0x6f, 0x75, 0x62, 0x74,
-}
-
-type hashed struct {
- hash []byte
- salt []byte
- cost int // allowed range is MinCost to MaxCost
- major byte
- minor byte
-}
-
-// GenerateFromPassword returns the bcrypt hash of the password at the given
-// cost. If the cost given is less than MinCost, the cost will be set to
-// DefaultCost, instead. Use CompareHashAndPassword, as defined in this package,
-// to compare the returned hashed password with its cleartext version.
-func GenerateFromPassword(password []byte, cost int) ([]byte, error) {
- p, err := newFromPassword(password, cost)
- if err != nil {
- return nil, err
- }
- return p.Hash(), nil
-}
-
-// CompareHashAndPassword compares a bcrypt hashed password with its possible
-// plaintext equivalent. Returns nil on success, or an error on failure.
-func CompareHashAndPassword(hashedPassword, password []byte) error {
- p, err := newFromHash(hashedPassword)
- if err != nil {
- return err
- }
-
- otherHash, err := bcrypt(password, p.cost, p.salt)
- if err != nil {
- return err
- }
-
- otherP := &hashed{otherHash, p.salt, p.cost, p.major, p.minor}
- if subtle.ConstantTimeCompare(p.Hash(), otherP.Hash()) == 1 {
- return nil
- }
-
- return ErrMismatchedHashAndPassword
-}
-
-// Cost returns the hashing cost used to create the given hashed
-// password. When, in the future, the hashing cost of a password system needs
-// to be increased in order to adjust for greater computational power, this
-// function allows one to establish which passwords need to be updated.
-func Cost(hashedPassword []byte) (int, error) {
- p, err := newFromHash(hashedPassword)
- if err != nil {
- return 0, err
- }
- return p.cost, nil
-}
-
-func newFromPassword(password []byte, cost int) (*hashed, error) {
- if cost < MinCost {
- cost = DefaultCost
- }
- p := new(hashed)
- p.major = majorVersion
- p.minor = minorVersion
-
- err := checkCost(cost)
- if err != nil {
- return nil, err
- }
- p.cost = cost
-
- unencodedSalt := make([]byte, maxSaltSize)
- _, err = io.ReadFull(rand.Reader, unencodedSalt)
- if err != nil {
- return nil, err
- }
-
- p.salt = base64Encode(unencodedSalt)
- hash, err := bcrypt(password, p.cost, p.salt)
- if err != nil {
- return nil, err
- }
- p.hash = hash
- return p, err
-}
-
-func newFromHash(hashedSecret []byte) (*hashed, error) {
- if len(hashedSecret) < minHashSize {
- return nil, ErrHashTooShort
- }
- p := new(hashed)
- n, err := p.decodeVersion(hashedSecret)
- if err != nil {
- return nil, err
- }
- hashedSecret = hashedSecret[n:]
- n, err = p.decodeCost(hashedSecret)
- if err != nil {
- return nil, err
- }
- hashedSecret = hashedSecret[n:]
-
- // The "+2" is here because we'll have to append at most 2 '=' to the salt
- // when base64 decoding it in expensiveBlowfishSetup().
- p.salt = make([]byte, encodedSaltSize, encodedSaltSize+2)
- copy(p.salt, hashedSecret[:encodedSaltSize])
-
- hashedSecret = hashedSecret[encodedSaltSize:]
- p.hash = make([]byte, len(hashedSecret))
- copy(p.hash, hashedSecret)
-
- return p, nil
-}
-
-func bcrypt(password []byte, cost int, salt []byte) ([]byte, error) {
- cipherData := make([]byte, len(magicCipherData))
- copy(cipherData, magicCipherData)
-
- c, err := expensiveBlowfishSetup(password, uint32(cost), salt)
- if err != nil {
- return nil, err
- }
-
- for i := 0; i < 24; i += 8 {
- for j := 0; j < 64; j++ {
- c.Encrypt(cipherData[i:i+8], cipherData[i:i+8])
- }
- }
-
- // Bug compatibility with C bcrypt implementations. We only encode 23 of
- // the 24 bytes encrypted.
- hsh := base64Encode(cipherData[:maxCryptedHashSize])
- return hsh, nil
-}
-
-func expensiveBlowfishSetup(key []byte, cost uint32, salt []byte) (*blowfish.Cipher, error) {
- csalt, err := base64Decode(salt)
- if err != nil {
- return nil, err
- }
-
- // Bug compatibility with C bcrypt implementations. They use the trailing
- // NULL in the key string during expansion.
- // We copy the key to prevent changing the underlying array.
- ckey := append(key[:len(key):len(key)], 0)
-
- c, err := blowfish.NewSaltedCipher(ckey, csalt)
- if err != nil {
- return nil, err
- }
-
- var i, rounds uint64
- rounds = 1 << cost
- for i = 0; i < rounds; i++ {
- blowfish.ExpandKey(ckey, c)
- blowfish.ExpandKey(csalt, c)
- }
-
- return c, nil
-}
-
-func (p *hashed) Hash() []byte {
- arr := make([]byte, 60)
- arr[0] = '$'
- arr[1] = p.major
- n := 2
- if p.minor != 0 {
- arr[2] = p.minor
- n = 3
- }
- arr[n] = '$'
- n++
- copy(arr[n:], []byte(fmt.Sprintf("%02d", p.cost)))
- n += 2
- arr[n] = '$'
- n++
- copy(arr[n:], p.salt)
- n += encodedSaltSize
- copy(arr[n:], p.hash)
- n += encodedHashSize
- return arr[:n]
-}
-
-func (p *hashed) decodeVersion(sbytes []byte) (int, error) {
- if sbytes[0] != '$' {
- return -1, InvalidHashPrefixError(sbytes[0])
- }
- if sbytes[1] > majorVersion {
- return -1, HashVersionTooNewError(sbytes[1])
- }
- p.major = sbytes[1]
- n := 3
- if sbytes[2] != '$' {
- p.minor = sbytes[2]
- n++
- }
- return n, nil
-}
-
-// sbytes should begin where decodeVersion left off.
-func (p *hashed) decodeCost(sbytes []byte) (int, error) {
- cost, err := strconv.Atoi(string(sbytes[0:2]))
- if err != nil {
- return -1, err
- }
- err = checkCost(cost)
- if err != nil {
- return -1, err
- }
- p.cost = cost
- return 3, nil
-}
-
-func (p *hashed) String() string {
- return fmt.Sprintf("&{hash: %#v, salt: %#v, cost: %d, major: %c, minor: %c}", string(p.hash), p.salt, p.cost, p.major, p.minor)
-}
-
-func checkCost(cost int) error {
- if cost < MinCost || cost > MaxCost {
- return InvalidCostError(cost)
- }
- return nil
-}
diff --git a/vendor/golang.org/x/crypto/blowfish/block.go b/vendor/golang.org/x/crypto/blowfish/block.go
deleted file mode 100644
index 9d80f19..0000000
--- a/vendor/golang.org/x/crypto/blowfish/block.go
+++ /dev/null
@@ -1,159 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-package blowfish
-
-// getNextWord returns the next big-endian uint32 value from the byte slice
-// at the given position in a circular manner, updating the position.
-func getNextWord(b []byte, pos *int) uint32 {
- var w uint32
- j := *pos
- for i := 0; i < 4; i++ {
- w = w<<8 | uint32(b[j])
- j++
- if j >= len(b) {
- j = 0
- }
- }
- *pos = j
- return w
-}
-
-// ExpandKey performs a key expansion on the given *Cipher. Specifically, it
-// performs the Blowfish algorithm's key schedule which sets up the *Cipher's
-// pi and substitution tables for calls to Encrypt. This is used, primarily,
-// by the bcrypt package to reuse the Blowfish key schedule during its
-// set up. It's unlikely that you need to use this directly.
-func ExpandKey(key []byte, c *Cipher) {
- j := 0
- for i := 0; i < 18; i++ {
- // Using inlined getNextWord for performance.
- var d uint32
- for k := 0; k < 4; k++ {
- d = d<<8 | uint32(key[j])
- j++
- if j >= len(key) {
- j = 0
- }
- }
- c.p[i] ^= d
- }
-
- var l, r uint32
- for i := 0; i < 18; i += 2 {
- l, r = encryptBlock(l, r, c)
- c.p[i], c.p[i+1] = l, r
- }
-
- for i := 0; i < 256; i += 2 {
- l, r = encryptBlock(l, r, c)
- c.s0[i], c.s0[i+1] = l, r
- }
- for i := 0; i < 256; i += 2 {
- l, r = encryptBlock(l, r, c)
- c.s1[i], c.s1[i+1] = l, r
- }
- for i := 0; i < 256; i += 2 {
- l, r = encryptBlock(l, r, c)
- c.s2[i], c.s2[i+1] = l, r
- }
- for i := 0; i < 256; i += 2 {
- l, r = encryptBlock(l, r, c)
- c.s3[i], c.s3[i+1] = l, r
- }
-}
-
-// This is similar to ExpandKey, but folds the salt during the key
-// schedule. While ExpandKey is essentially expandKeyWithSalt with an all-zero
-// salt passed in, reusing ExpandKey turns out to be a place of inefficiency
-// and specializing it here is useful.
-func expandKeyWithSalt(key []byte, salt []byte, c *Cipher) {
- j := 0
- for i := 0; i < 18; i++ {
- c.p[i] ^= getNextWord(key, &j)
- }
-
- j = 0
- var l, r uint32
- for i := 0; i < 18; i += 2 {
- l ^= getNextWord(salt, &j)
- r ^= getNextWord(salt, &j)
- l, r = encryptBlock(l, r, c)
- c.p[i], c.p[i+1] = l, r
- }
-
- for i := 0; i < 256; i += 2 {
- l ^= getNextWord(salt, &j)
- r ^= getNextWord(salt, &j)
- l, r = encryptBlock(l, r, c)
- c.s0[i], c.s0[i+1] = l, r
- }
-
- for i := 0; i < 256; i += 2 {
- l ^= getNextWord(salt, &j)
- r ^= getNextWord(salt, &j)
- l, r = encryptBlock(l, r, c)
- c.s1[i], c.s1[i+1] = l, r
- }
-
- for i := 0; i < 256; i += 2 {
- l ^= getNextWord(salt, &j)
- r ^= getNextWord(salt, &j)
- l, r = encryptBlock(l, r, c)
- c.s2[i], c.s2[i+1] = l, r
- }
-
- for i := 0; i < 256; i += 2 {
- l ^= getNextWord(salt, &j)
- r ^= getNextWord(salt, &j)
- l, r = encryptBlock(l, r, c)
- c.s3[i], c.s3[i+1] = l, r
- }
-}
-
-func encryptBlock(l, r uint32, c *Cipher) (uint32, uint32) {
- xl, xr := l, r
- xl ^= c.p[0]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[1]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[2]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[3]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[4]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[5]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[6]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[7]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[8]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[9]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[10]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[11]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[12]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[13]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[14]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[15]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[16]
- xr ^= c.p[17]
- return xr, xl
-}
-
-func decryptBlock(l, r uint32, c *Cipher) (uint32, uint32) {
- xl, xr := l, r
- xl ^= c.p[17]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[16]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[15]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[14]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[13]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[12]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[11]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[10]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[9]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[8]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[7]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[6]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[5]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[4]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[3]
- xr ^= ((c.s0[byte(xl>>24)] + c.s1[byte(xl>>16)]) ^ c.s2[byte(xl>>8)]) + c.s3[byte(xl)] ^ c.p[2]
- xl ^= ((c.s0[byte(xr>>24)] + c.s1[byte(xr>>16)]) ^ c.s2[byte(xr>>8)]) + c.s3[byte(xr)] ^ c.p[1]
- xr ^= c.p[0]
- return xr, xl
-}
diff --git a/vendor/golang.org/x/crypto/blowfish/cipher.go b/vendor/golang.org/x/crypto/blowfish/cipher.go
deleted file mode 100644
index 2641dad..0000000
--- a/vendor/golang.org/x/crypto/blowfish/cipher.go
+++ /dev/null
@@ -1,91 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// Package blowfish implements Bruce Schneier's Blowfish encryption algorithm.
-package blowfish // import "golang.org/x/crypto/blowfish"
-
-// The code is a port of Bruce Schneier's C implementation.
-// See https://www.schneier.com/blowfish.html.
-
-import "strconv"
-
-// The Blowfish block size in bytes.
-const BlockSize = 8
-
-// A Cipher is an instance of Blowfish encryption using a particular key.
-type Cipher struct {
- p [18]uint32
- s0, s1, s2, s3 [256]uint32
-}
-
-type KeySizeError int
-
-func (k KeySizeError) Error() string {
- return "crypto/blowfish: invalid key size " + strconv.Itoa(int(k))
-}
-
-// NewCipher creates and returns a Cipher.
-// The key argument should be the Blowfish key, from 1 to 56 bytes.
-func NewCipher(key []byte) (*Cipher, error) {
- var result Cipher
- if k := len(key); k < 1 || k > 56 {
- return nil, KeySizeError(k)
- }
- initCipher(&result)
- ExpandKey(key, &result)
- return &result, nil
-}
-
-// NewSaltedCipher creates a returns a Cipher that folds a salt into its key
-// schedule. For most purposes, NewCipher, instead of NewSaltedCipher, is
-// sufficient and desirable. For bcrypt compatibility, the key can be over 56
-// bytes.
-func NewSaltedCipher(key, salt []byte) (*Cipher, error) {
- if len(salt) == 0 {
- return NewCipher(key)
- }
- var result Cipher
- if k := len(key); k < 1 {
- return nil, KeySizeError(k)
- }
- initCipher(&result)
- expandKeyWithSalt(key, salt, &result)
- return &result, nil
-}
-
-// BlockSize returns the Blowfish block size, 8 bytes.
-// It is necessary to satisfy the Block interface in the
-// package "crypto/cipher".
-func (c *Cipher) BlockSize() int { return BlockSize }
-
-// Encrypt encrypts the 8-byte buffer src using the key k
-// and stores the result in dst.
-// Note that for amounts of data larger than a block,
-// it is not safe to just call Encrypt on successive blocks;
-// instead, use an encryption mode like CBC (see crypto/cipher/cbc.go).
-func (c *Cipher) Encrypt(dst, src []byte) {
- l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])
- r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])
- l, r = encryptBlock(l, r, c)
- dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l)
- dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r)
-}
-
-// Decrypt decrypts the 8-byte buffer src using the key k
-// and stores the result in dst.
-func (c *Cipher) Decrypt(dst, src []byte) {
- l := uint32(src[0])<<24 | uint32(src[1])<<16 | uint32(src[2])<<8 | uint32(src[3])
- r := uint32(src[4])<<24 | uint32(src[5])<<16 | uint32(src[6])<<8 | uint32(src[7])
- l, r = decryptBlock(l, r, c)
- dst[0], dst[1], dst[2], dst[3] = byte(l>>24), byte(l>>16), byte(l>>8), byte(l)
- dst[4], dst[5], dst[6], dst[7] = byte(r>>24), byte(r>>16), byte(r>>8), byte(r)
-}
-
-func initCipher(c *Cipher) {
- copy(c.p[0:], p[0:])
- copy(c.s0[0:], s0[0:])
- copy(c.s1[0:], s1[0:])
- copy(c.s2[0:], s2[0:])
- copy(c.s3[0:], s3[0:])
-}
diff --git a/vendor/golang.org/x/crypto/blowfish/const.go b/vendor/golang.org/x/crypto/blowfish/const.go
deleted file mode 100644
index d040775..0000000
--- a/vendor/golang.org/x/crypto/blowfish/const.go
+++ /dev/null
@@ -1,199 +0,0 @@
-// Copyright 2010 The Go Authors. All rights reserved.
-// Use of this source code is governed by a BSD-style
-// license that can be found in the LICENSE file.
-
-// The startup permutation array and substitution boxes.
-// They are the hexadecimal digits of PI; see:
-// https://www.schneier.com/code/constants.txt.
-
-package blowfish
-
-var s0 = [256]uint32{
- 0xd1310ba6, 0x98dfb5ac, 0x2ffd72db, 0xd01adfb7, 0xb8e1afed, 0x6a267e96,
- 0xba7c9045, 0xf12c7f99, 0x24a19947, 0xb3916cf7, 0x0801f2e2, 0x858efc16,
- 0x636920d8, 0x71574e69, 0xa458fea3, 0xf4933d7e, 0x0d95748f, 0x728eb658,
- 0x718bcd58, 0x82154aee, 0x7b54a41d, 0xc25a59b5, 0x9c30d539, 0x2af26013,
- 0xc5d1b023, 0x286085f0, 0xca417918, 0xb8db38ef, 0x8e79dcb0, 0x603a180e,
- 0x6c9e0e8b, 0xb01e8a3e, 0xd71577c1, 0xbd314b27, 0x78af2fda, 0x55605c60,
- 0xe65525f3, 0xaa55ab94, 0x57489862, 0x63e81440, 0x55ca396a, 0x2aab10b6,
- 0xb4cc5c34, 0x1141e8ce, 0xa15486af, 0x7c72e993, 0xb3ee1411, 0x636fbc2a,
- 0x2ba9c55d, 0x741831f6, 0xce5c3e16, 0x9b87931e, 0xafd6ba33, 0x6c24cf5c,
- 0x7a325381, 0x28958677, 0x3b8f4898, 0x6b4bb9af, 0xc4bfe81b, 0x66282193,
- 0x61d809cc, 0xfb21a991, 0x487cac60, 0x5dec8032, 0xef845d5d, 0xe98575b1,
- 0xdc262302, 0xeb651b88, 0x23893e81, 0xd396acc5, 0x0f6d6ff3, 0x83f44239,
- 0x2e0b4482, 0xa4842004, 0x69c8f04a, 0x9e1f9b5e, 0x21c66842, 0xf6e96c9a,
- 0x670c9c61, 0xabd388f0, 0x6a51a0d2, 0xd8542f68, 0x960fa728, 0xab5133a3,
- 0x6eef0b6c, 0x137a3be4, 0xba3bf050, 0x7efb2a98, 0xa1f1651d, 0x39af0176,
- 0x66ca593e, 0x82430e88, 0x8cee8619, 0x456f9fb4, 0x7d84a5c3, 0x3b8b5ebe,
- 0xe06f75d8, 0x85c12073, 0x401a449f, 0x56c16aa6, 0x4ed3aa62, 0x363f7706,
- 0x1bfedf72, 0x429b023d, 0x37d0d724, 0xd00a1248, 0xdb0fead3, 0x49f1c09b,
- 0x075372c9, 0x80991b7b, 0x25d479d8, 0xf6e8def7, 0xe3fe501a, 0xb6794c3b,
- 0x976ce0bd, 0x04c006ba, 0xc1a94fb6, 0x409f60c4, 0x5e5c9ec2, 0x196a2463,
- 0x68fb6faf, 0x3e6c53b5, 0x1339b2eb, 0x3b52ec6f, 0x6dfc511f, 0x9b30952c,
- 0xcc814544, 0xaf5ebd09, 0xbee3d004, 0xde334afd, 0x660f2807, 0x192e4bb3,
- 0xc0cba857, 0x45c8740f, 0xd20b5f39, 0xb9d3fbdb, 0x5579c0bd, 0x1a60320a,
- 0xd6a100c6, 0x402c7279, 0x679f25fe, 0xfb1fa3cc, 0x8ea5e9f8, 0xdb3222f8,
- 0x3c7516df, 0xfd616b15, 0x2f501ec8, 0xad0552ab, 0x323db5fa, 0xfd238760,
- 0x53317b48, 0x3e00df82, 0x9e5c57bb, 0xca6f8ca0, 0x1a87562e, 0xdf1769db,
- 0xd542a8f6, 0x287effc3, 0xac6732c6, 0x8c4f5573, 0x695b27b0, 0xbbca58c8,
- 0xe1ffa35d, 0xb8f011a0, 0x10fa3d98, 0xfd2183b8, 0x4afcb56c, 0x2dd1d35b,
- 0x9a53e479, 0xb6f84565, 0xd28e49bc, 0x4bfb9790, 0xe1ddf2da, 0xa4cb7e33,
- 0x62fb1341, 0xcee4c6e8, 0xef20cada, 0x36774c01, 0xd07e9efe, 0x2bf11fb4,
- 0x95dbda4d, 0xae909198, 0xeaad8e71, 0x6b93d5a0, 0xd08ed1d0, 0xafc725e0,
- 0x8e3c5b2f, 0x8e7594b7, 0x8ff6e2fb, 0xf2122b64, 0x8888b812, 0x900df01c,
- 0x4fad5ea0, 0x688fc31c, 0xd1cff191, 0xb3a8c1ad, 0x2f2f2218, 0xbe0e1777,
- 0xea752dfe, 0x8b021fa1, 0xe5a0cc0f, 0xb56f74e8, 0x18acf3d6, 0xce89e299,
- 0xb4a84fe0, 0xfd13e0b7, 0x7cc43b81, 0xd2ada8d9, 0x165fa266, 0x80957705,
- 0x93cc7314, 0x211a1477, 0xe6ad2065, 0x77b5fa86, 0xc75442f5, 0xfb9d35cf,
- 0xebcdaf0c, 0x7b3e89a0, 0xd6411bd3, 0xae1e7e49, 0x00250e2d, 0x2071b35e,
- 0x226800bb, 0x57b8e0af, 0x2464369b, 0xf009b91e, 0x5563911d, 0x59dfa6aa,
- 0x78c14389, 0xd95a537f, 0x207d5ba2, 0x02e5b9c5, 0x83260376, 0x6295cfa9,
- 0x11c81968, 0x4e734a41, 0xb3472dca, 0x7b14a94a, 0x1b510052, 0x9a532915,
- 0xd60f573f, 0xbc9bc6e4, 0x2b60a476, 0x81e67400, 0x08ba6fb5, 0x571be91f,
- 0xf296ec6b, 0x2a0dd915, 0xb6636521, 0xe7b9f9b6, 0xff34052e, 0xc5855664,
- 0x53b02d5d, 0xa99f8fa1, 0x08ba4799, 0x6e85076a,
-}
-
-var s1 = [256]uint32{
- 0x4b7a70e9, 0xb5b32944, 0xdb75092e, 0xc4192623, 0xad6ea6b0, 0x49a7df7d,
- 0x9cee60b8, 0x8fedb266, 0xecaa8c71, 0x699a17ff, 0x5664526c, 0xc2b19ee1,
- 0x193602a5, 0x75094c29, 0xa0591340, 0xe4183a3e, 0x3f54989a, 0x5b429d65,
- 0x6b8fe4d6, 0x99f73fd6, 0xa1d29c07, 0xefe830f5, 0x4d2d38e6, 0xf0255dc1,
- 0x4cdd2086, 0x8470eb26, 0x6382e9c6, 0x021ecc5e, 0x09686b3f, 0x3ebaefc9,
- 0x3c971814, 0x6b6a70a1, 0x687f3584, 0x52a0e286, 0xb79c5305, 0xaa500737,
- 0x3e07841c, 0x7fdeae5c, 0x8e7d44ec, 0x5716f2b8, 0xb03ada37, 0xf0500c0d,
- 0xf01c1f04, 0x0200b3ff, 0xae0cf51a, 0x3cb574b2, 0x25837a58, 0xdc0921bd,
- 0xd19113f9, 0x7ca92ff6, 0x94324773, 0x22f54701, 0x3ae5e581, 0x37c2dadc,
- 0xc8b57634, 0x9af3dda7, 0xa9446146, 0x0fd0030e, 0xecc8c73e, 0xa4751e41,
- 0xe238cd99, 0x3bea0e2f, 0x3280bba1, 0x183eb331, 0x4e548b38, 0x4f6db908,
- 0x6f420d03, 0xf60a04bf, 0x2cb81290, 0x24977c79, 0x5679b072, 0xbcaf89af,
- 0xde9a771f, 0xd9930810, 0xb38bae12, 0xdccf3f2e, 0x5512721f, 0x2e6b7124,
- 0x501adde6, 0x9f84cd87, 0x7a584718, 0x7408da17, 0xbc9f9abc, 0xe94b7d8c,
- 0xec7aec3a, 0xdb851dfa, 0x63094366, 0xc464c3d2, 0xef1c1847, 0x3215d908,
- 0xdd433b37, 0x24c2ba16, 0x12a14d43, 0x2a65c451, 0x50940002, 0x133ae4dd,
- 0x71dff89e, 0x10314e55, 0x81ac77d6, 0x5f11199b, 0x043556f1, 0xd7a3c76b,
- 0x3c11183b, 0x5924a509, 0xf28fe6ed, 0x97f1fbfa, 0x9ebabf2c, 0x1e153c6e,
- 0x86e34570, 0xeae96fb1, 0x860e5e0a, 0x5a3e2ab3, 0x771fe71c, 0x4e3d06fa,
- 0x2965dcb9, 0x99e71d0f, 0x803e89d6, 0x5266c825, 0x2e4cc978, 0x9c10b36a,
- 0xc6150eba, 0x94e2ea78, 0xa5fc3c53, 0x1e0a2df4, 0xf2f74ea7, 0x361d2b3d,
- 0x1939260f, 0x19c27960, 0x5223a708, 0xf71312b6, 0xebadfe6e, 0xeac31f66,
- 0xe3bc4595, 0xa67bc883, 0xb17f37d1, 0x018cff28, 0xc332ddef, 0xbe6c5aa5,
- 0x65582185, 0x68ab9802, 0xeecea50f, 0xdb2f953b, 0x2aef7dad, 0x5b6e2f84,
- 0x1521b628, 0x29076170, 0xecdd4775, 0x619f1510, 0x13cca830, 0xeb61bd96,
- 0x0334fe1e, 0xaa0363cf, 0xb5735c90, 0x4c70a239, 0xd59e9e0b, 0xcbaade14,
- 0xeecc86bc, 0x60622ca7, 0x9cab5cab, 0xb2f3846e, 0x648b1eaf, 0x19bdf0ca,
- 0xa02369b9, 0x655abb50, 0x40685a32, 0x3c2ab4b3, 0x319ee9d5, 0xc021b8f7,
- 0x9b540b19, 0x875fa099, 0x95f7997e, 0x623d7da8, 0xf837889a, 0x97e32d77,
- 0x11ed935f, 0x16681281, 0x0e358829, 0xc7e61fd6, 0x96dedfa1, 0x7858ba99,
- 0x57f584a5, 0x1b227263, 0x9b83c3ff, 0x1ac24696, 0xcdb30aeb, 0x532e3054,
- 0x8fd948e4, 0x6dbc3128, 0x58ebf2ef, 0x34c6ffea, 0xfe28ed61, 0xee7c3c73,
- 0x5d4a14d9, 0xe864b7e3, 0x42105d14, 0x203e13e0, 0x45eee2b6, 0xa3aaabea,
- 0xdb6c4f15, 0xfacb4fd0, 0xc742f442, 0xef6abbb5, 0x654f3b1d, 0x41cd2105,
- 0xd81e799e, 0x86854dc7, 0xe44b476a, 0x3d816250, 0xcf62a1f2, 0x5b8d2646,
- 0xfc8883a0, 0xc1c7b6a3, 0x7f1524c3, 0x69cb7492, 0x47848a0b, 0x5692b285,
- 0x095bbf00, 0xad19489d, 0x1462b174, 0x23820e00, 0x58428d2a, 0x0c55f5ea,
- 0x1dadf43e, 0x233f7061, 0x3372f092, 0x8d937e41, 0xd65fecf1, 0x6c223bdb,
- 0x7cde3759, 0xcbee7460, 0x4085f2a7, 0xce77326e, 0xa6078084, 0x19f8509e,
- 0xe8efd855, 0x61d99735, 0xa969a7aa, 0xc50c06c2, 0x5a04abfc, 0x800bcadc,
- 0x9e447a2e, 0xc3453484, 0xfdd56705, 0x0e1e9ec9, 0xdb73dbd3, 0x105588cd,
- 0x675fda79, 0xe3674340, 0xc5c43465, 0x713e38d8, 0x3d28f89e, 0xf16dff20,
- 0x153e21e7, 0x8fb03d4a, 0xe6e39f2b, 0xdb83adf7,
-}
-
-var s2 = [256]uint32{
- 0xe93d5a68, 0x948140f7, 0xf64c261c, 0x94692934, 0x411520f7, 0x7602d4f7,
- 0xbcf46b2e, 0xd4a20068, 0xd4082471, 0x3320f46a, 0x43b7d4b7, 0x500061af,
- 0x1e39f62e, 0x97244546, 0x14214f74, 0xbf8b8840, 0x4d95fc1d, 0x96b591af,
- 0x70f4ddd3, 0x66a02f45, 0xbfbc09ec, 0x03bd9785, 0x7fac6dd0, 0x31cb8504,
- 0x96eb27b3, 0x55fd3941, 0xda2547e6, 0xabca0a9a, 0x28507825, 0x530429f4,
- 0x0a2c86da, 0xe9b66dfb, 0x68dc1462, 0xd7486900, 0x680ec0a4, 0x27a18dee,
- 0x4f3ffea2, 0xe887ad8c, 0xb58ce006, 0x7af4d6b6, 0xaace1e7c, 0xd3375fec,
- 0xce78a399, 0x406b2a42, 0x20fe9e35, 0xd9f385b9, 0xee39d7ab, 0x3b124e8b,
- 0x1dc9faf7, 0x4b6d1856, 0x26a36631, 0xeae397b2, 0x3a6efa74, 0xdd5b4332,
- 0x6841e7f7, 0xca7820fb, 0xfb0af54e, 0xd8feb397, 0x454056ac, 0xba489527,
- 0x55533a3a, 0x20838d87, 0xfe6ba9b7, 0xd096954b, 0x55a867bc, 0xa1159a58,
- 0xcca92963, 0x99e1db33, 0xa62a4a56, 0x3f3125f9, 0x5ef47e1c, 0x9029317c,
- 0xfdf8e802, 0x04272f70, 0x80bb155c, 0x05282ce3, 0x95c11548, 0xe4c66d22,
- 0x48c1133f, 0xc70f86dc, 0x07f9c9ee, 0x41041f0f, 0x404779a4, 0x5d886e17,
- 0x325f51eb, 0xd59bc0d1, 0xf2bcc18f, 0x41113564, 0x257b7834, 0x602a9c60,
- 0xdff8e8a3, 0x1f636c1b, 0x0e12b4c2, 0x02e1329e, 0xaf664fd1, 0xcad18115,
- 0x6b2395e0, 0x333e92e1, 0x3b240b62, 0xeebeb922, 0x85b2a20e, 0xe6ba0d99,
- 0xde720c8c, 0x2da2f728, 0xd0127845, 0x95b794fd, 0x647d0862, 0xe7ccf5f0,
- 0x5449a36f, 0x877d48fa, 0xc39dfd27, 0xf33e8d1e, 0x0a476341, 0x992eff74,
- 0x3a6f6eab, 0xf4f8fd37, 0xa812dc60, 0xa1ebddf8, 0x991be14c, 0xdb6e6b0d,
- 0xc67b5510, 0x6d672c37, 0x2765d43b, 0xdcd0e804, 0xf1290dc7, 0xcc00ffa3,
- 0xb5390f92, 0x690fed0b, 0x667b9ffb, 0xcedb7d9c, 0xa091cf0b, 0xd9155ea3,
- 0xbb132f88, 0x515bad24, 0x7b9479bf, 0x763bd6eb, 0x37392eb3, 0xcc115979,
- 0x8026e297, 0xf42e312d, 0x6842ada7, 0xc66a2b3b, 0x12754ccc, 0x782ef11c,
- 0x6a124237, 0xb79251e7, 0x06a1bbe6, 0x4bfb6350, 0x1a6b1018, 0x11caedfa,
- 0x3d25bdd8, 0xe2e1c3c9, 0x44421659, 0x0a121386, 0xd90cec6e, 0xd5abea2a,
- 0x64af674e, 0xda86a85f, 0xbebfe988, 0x64e4c3fe, 0x9dbc8057, 0xf0f7c086,
- 0x60787bf8, 0x6003604d, 0xd1fd8346, 0xf6381fb0, 0x7745ae04, 0xd736fccc,
- 0x83426b33, 0xf01eab71, 0xb0804187, 0x3c005e5f, 0x77a057be, 0xbde8ae24,
- 0x55464299, 0xbf582e61, 0x4e58f48f, 0xf2ddfda2, 0xf474ef38, 0x8789bdc2,
- 0x5366f9c3, 0xc8b38e74, 0xb475f255, 0x46fcd9b9, 0x7aeb2661, 0x8b1ddf84,
- 0x846a0e79, 0x915f95e2, 0x466e598e, 0x20b45770, 0x8cd55591, 0xc902de4c,
- 0xb90bace1, 0xbb8205d0, 0x11a86248, 0x7574a99e, 0xb77f19b6, 0xe0a9dc09,
- 0x662d09a1, 0xc4324633, 0xe85a1f02, 0x09f0be8c, 0x4a99a025, 0x1d6efe10,
- 0x1ab93d1d, 0x0ba5a4df, 0xa186f20f, 0x2868f169, 0xdcb7da83, 0x573906fe,
- 0xa1e2ce9b, 0x4fcd7f52, 0x50115e01, 0xa70683fa, 0xa002b5c4, 0x0de6d027,
- 0x9af88c27, 0x773f8641, 0xc3604c06, 0x61a806b5, 0xf0177a28, 0xc0f586e0,
- 0x006058aa, 0x30dc7d62, 0x11e69ed7, 0x2338ea63, 0x53c2dd94, 0xc2c21634,
- 0xbbcbee56, 0x90bcb6de, 0xebfc7da1, 0xce591d76, 0x6f05e409, 0x4b7c0188,
- 0x39720a3d, 0x7c927c24, 0x86e3725f, 0x724d9db9, 0x1ac15bb4, 0xd39eb8fc,
- 0xed545578, 0x08fca5b5, 0xd83d7cd3, 0x4dad0fc4, 0x1e50ef5e, 0xb161e6f8,
- 0xa28514d9, 0x6c51133c, 0x6fd5c7e7, 0x56e14ec4, 0x362abfce, 0xddc6c837,
- 0xd79a3234, 0x92638212, 0x670efa8e, 0x406000e0,
-}
-
-var s3 = [256]uint32{
- 0x3a39ce37, 0xd3faf5cf, 0xabc27737, 0x5ac52d1b, 0x5cb0679e, 0x4fa33742,
- 0xd3822740, 0x99bc9bbe, 0xd5118e9d, 0xbf0f7315, 0xd62d1c7e, 0xc700c47b,
- 0xb78c1b6b, 0x21a19045, 0xb26eb1be, 0x6a366eb4, 0x5748ab2f, 0xbc946e79,
- 0xc6a376d2, 0x6549c2c8, 0x530ff8ee, 0x468dde7d, 0xd5730a1d, 0x4cd04dc6,
- 0x2939bbdb, 0xa9ba4650, 0xac9526e8, 0xbe5ee304, 0xa1fad5f0, 0x6a2d519a,
- 0x63ef8ce2, 0x9a86ee22, 0xc089c2b8, 0x43242ef6, 0xa51e03aa, 0x9cf2d0a4,
- 0x83c061ba, 0x9be96a4d, 0x8fe51550, 0xba645bd6, 0x2826a2f9, 0xa73a3ae1,
- 0x4ba99586, 0xef5562e9, 0xc72fefd3, 0xf752f7da, 0x3f046f69, 0x77fa0a59,
- 0x80e4a915, 0x87b08601, 0x9b09e6ad, 0x3b3ee593, 0xe990fd5a, 0x9e34d797,
- 0x2cf0b7d9, 0x022b8b51, 0x96d5ac3a, 0x017da67d, 0xd1cf3ed6, 0x7c7d2d28,
- 0x1f9f25cf, 0xadf2b89b, 0x5ad6b472, 0x5a88f54c, 0xe029ac71, 0xe019a5e6,
- 0x47b0acfd, 0xed93fa9b, 0xe8d3c48d, 0x283b57cc, 0xf8d56629, 0x79132e28,
- 0x785f0191, 0xed756055, 0xf7960e44, 0xe3d35e8c, 0x15056dd4, 0x88f46dba,
- 0x03a16125, 0x0564f0bd, 0xc3eb9e15, 0x3c9057a2, 0x97271aec, 0xa93a072a,
- 0x1b3f6d9b, 0x1e6321f5, 0xf59c66fb, 0x26dcf319, 0x7533d928, 0xb155fdf5,
- 0x03563482, 0x8aba3cbb, 0x28517711, 0xc20ad9f8, 0xabcc5167, 0xccad925f,
- 0x4de81751, 0x3830dc8e, 0x379d5862, 0x9320f991, 0xea7a90c2, 0xfb3e7bce,
- 0x5121ce64, 0x774fbe32, 0xa8b6e37e, 0xc3293d46, 0x48de5369, 0x6413e680,
- 0xa2ae0810, 0xdd6db224, 0x69852dfd, 0x09072166, 0xb39a460a, 0x6445c0dd,
- 0x586cdecf, 0x1c20c8ae, 0x5bbef7dd, 0x1b588d40, 0xccd2017f, 0x6bb4e3bb,
- 0xdda26a7e, 0x3a59ff45, 0x3e350a44, 0xbcb4cdd5, 0x72eacea8, 0xfa6484bb,
- 0x8d6612ae, 0xbf3c6f47, 0xd29be463, 0x542f5d9e, 0xaec2771b, 0xf64e6370,
- 0x740e0d8d, 0xe75b1357, 0xf8721671, 0xaf537d5d, 0x4040cb08, 0x4eb4e2cc,
- 0x34d2466a, 0x0115af84, 0xe1b00428, 0x95983a1d, 0x06b89fb4, 0xce6ea048,
- 0x6f3f3b82, 0x3520ab82, 0x011a1d4b, 0x277227f8, 0x611560b1, 0xe7933fdc,
- 0xbb3a792b, 0x344525bd, 0xa08839e1, 0x51ce794b, 0x2f32c9b7, 0xa01fbac9,
- 0xe01cc87e, 0xbcc7d1f6, 0xcf0111c3, 0xa1e8aac7, 0x1a908749, 0xd44fbd9a,
- 0xd0dadecb, 0xd50ada38, 0x0339c32a, 0xc6913667, 0x8df9317c, 0xe0b12b4f,
- 0xf79e59b7, 0x43f5bb3a, 0xf2d519ff, 0x27d9459c, 0xbf97222c, 0x15e6fc2a,
- 0x0f91fc71, 0x9b941525, 0xfae59361, 0xceb69ceb, 0xc2a86459, 0x12baa8d1,
- 0xb6c1075e, 0xe3056a0c, 0x10d25065, 0xcb03a442, 0xe0ec6e0e, 0x1698db3b,
- 0x4c98a0be, 0x3278e964, 0x9f1f9532, 0xe0d392df, 0xd3a0342b, 0x8971f21e,
- 0x1b0a7441, 0x4ba3348c, 0xc5be7120, 0xc37632d8, 0xdf359f8d, 0x9b992f2e,
- 0xe60b6f47, 0x0fe3f11d, 0xe54cda54, 0x1edad891, 0xce6279cf, 0xcd3e7e6f,
- 0x1618b166, 0xfd2c1d05, 0x848fd2c5, 0xf6fb2299, 0xf523f357, 0xa6327623,
- 0x93a83531, 0x56cccd02, 0xacf08162, 0x5a75ebb5, 0x6e163697, 0x88d273cc,
- 0xde966292, 0x81b949d0, 0x4c50901b, 0x71c65614, 0xe6c6c7bd, 0x327a140a,
- 0x45e1d006, 0xc3f27b9a, 0xc9aa53fd, 0x62a80f00, 0xbb25bfe2, 0x35bdd2f6,
- 0x71126905, 0xb2040222, 0xb6cbcf7c, 0xcd769c2b, 0x53113ec0, 0x1640e3d3,
- 0x38abbd60, 0x2547adf0, 0xba38209c, 0xf746ce76, 0x77afa1c5, 0x20756060,
- 0x85cbfe4e, 0x8ae88dd8, 0x7aaaf9b0, 0x4cf9aa7e, 0x1948c25c, 0x02fb8a8c,
- 0x01c36ae4, 0xd6ebe1f9, 0x90d4f869, 0xa65cdea0, 0x3f09252d, 0xc208e69f,
- 0xb74e6132, 0xce77e25b, 0x578fdfe3, 0x3ac372e6,
-}
-
-var p = [18]uint32{
- 0x243f6a88, 0x85a308d3, 0x13198a2e, 0x03707344, 0xa4093822, 0x299f31d0,
- 0x082efa98, 0xec4e6c89, 0x452821e6, 0x38d01377, 0xbe5466cf, 0x34e90c6c,
- 0xc0ac29b7, 0xc97c50dd, 0x3f84d5b5, 0xb5470917, 0x9216d5d9, 0x8979fb1b,
-}