bump(6644d4): spf13/cobra: support bash completion for aliases

This commit is contained in:
Nikhita Raghunath 2018-03-02 21:21:07 +05:30
parent ae1fc13aee
commit bae2db8b95
6 changed files with 167 additions and 141 deletions

174
Godeps/Godeps.json generated
View File

@ -462,47 +462,47 @@
}, },
{ {
"ImportPath": "github.com/containerd/containerd/api/services/containers/v1", "ImportPath": "github.com/containerd/containerd/api/services/containers/v1",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/api/services/tasks/v1", "ImportPath": "github.com/containerd/containerd/api/services/tasks/v1",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/api/services/version/v1", "ImportPath": "github.com/containerd/containerd/api/services/version/v1",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/api/types", "ImportPath": "github.com/containerd/containerd/api/types",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/api/types/task", "ImportPath": "github.com/containerd/containerd/api/types/task",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/containers", "ImportPath": "github.com/containerd/containerd/containers",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/dialer", "ImportPath": "github.com/containerd/containerd/dialer",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/errdefs", "ImportPath": "github.com/containerd/containerd/errdefs",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
"ImportPath": "github.com/containerd/containerd/namespaces", "ImportPath": "github.com/containerd/containerd/namespaces",
"Comment": "v1.0.0-beta.2-159-g27d450a", "Comment": "v1.0.0-beta.2-159-g27d450a0",
"Rev": "27d450a01bb533d7ebc5701eb52792565396b084" "Rev": "27d450a01bb533d7ebc5701eb52792565396b084"
}, },
{ {
@ -991,157 +991,157 @@
}, },
{ {
"ImportPath": "github.com/docker/distribution/digestset", "ImportPath": "github.com/docker/distribution/digestset",
"Comment": "v2.6.0-rc.1-209-gedc3ab2", "Comment": "v2.6.0-rc.1-209-gedc3ab29",
"Rev": "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c" "Rev": "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c"
}, },
{ {
"ImportPath": "github.com/docker/distribution/reference", "ImportPath": "github.com/docker/distribution/reference",
"Comment": "v2.6.0-rc.1-209-gedc3ab2", "Comment": "v2.6.0-rc.1-209-gedc3ab29",
"Rev": "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c" "Rev": "edc3ab29cdff8694dd6feb85cfeb4b5f1b38ed9c"
}, },
{ {
"ImportPath": "github.com/docker/docker/api", "ImportPath": "github.com/docker/docker/api",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types", "ImportPath": "github.com/docker/docker/api/types",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/blkiodev", "ImportPath": "github.com/docker/docker/api/types/blkiodev",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/container", "ImportPath": "github.com/docker/docker/api/types/container",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/events", "ImportPath": "github.com/docker/docker/api/types/events",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/filters", "ImportPath": "github.com/docker/docker/api/types/filters",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/image", "ImportPath": "github.com/docker/docker/api/types/image",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/mount", "ImportPath": "github.com/docker/docker/api/types/mount",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/network", "ImportPath": "github.com/docker/docker/api/types/network",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/registry", "ImportPath": "github.com/docker/docker/api/types/registry",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/strslice", "ImportPath": "github.com/docker/docker/api/types/strslice",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/swarm", "ImportPath": "github.com/docker/docker/api/types/swarm",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/swarm/runtime", "ImportPath": "github.com/docker/docker/api/types/swarm/runtime",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/time", "ImportPath": "github.com/docker/docker/api/types/time",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/versions", "ImportPath": "github.com/docker/docker/api/types/versions",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/api/types/volume", "ImportPath": "github.com/docker/docker/api/types/volume",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/client", "ImportPath": "github.com/docker/docker/client",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/ioutils", "ImportPath": "github.com/docker/docker/pkg/ioutils",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/jsonlog", "ImportPath": "github.com/docker/docker/pkg/jsonlog",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/jsonmessage", "ImportPath": "github.com/docker/docker/pkg/jsonmessage",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/longpath", "ImportPath": "github.com/docker/docker/pkg/longpath",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/mount", "ImportPath": "github.com/docker/docker/pkg/mount",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/parsers", "ImportPath": "github.com/docker/docker/pkg/parsers",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/stdcopy", "ImportPath": "github.com/docker/docker/pkg/stdcopy",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/sysinfo", "ImportPath": "github.com/docker/docker/pkg/sysinfo",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/system", "ImportPath": "github.com/docker/docker/pkg/system",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/term", "ImportPath": "github.com/docker/docker/pkg/term",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/term/windows", "ImportPath": "github.com/docker/docker/pkg/term/windows",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
"ImportPath": "github.com/docker/docker/pkg/tlsconfig", "ImportPath": "github.com/docker/docker/pkg/tlsconfig",
"Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616f", "Comment": "docs-v1.12.0-rc4-2016-07-15-7401-g4f3616fb1",
"Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756" "Rev": "4f3616fb1c112e206b88cb7a9922bf49067a7756"
}, },
{ {
@ -1166,7 +1166,7 @@
}, },
{ {
"ImportPath": "github.com/docker/libnetwork/ipvs", "ImportPath": "github.com/docker/libnetwork/ipvs",
"Comment": "v0.8.0-dev.2-910-gba46b92", "Comment": "v0.8.0-dev.2-910-gba46b928",
"Rev": "ba46b928444931e6865d8618dc03622cac79aa6f" "Rev": "ba46b928444931e6865d8618dc03622cac79aa6f"
}, },
{ {
@ -1293,132 +1293,132 @@
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/gogoproto", "ImportPath": "github.com/gogo/protobuf/gogoproto",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/compare", "ImportPath": "github.com/gogo/protobuf/plugin/compare",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck", "ImportPath": "github.com/gogo/protobuf/plugin/defaultcheck",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/description", "ImportPath": "github.com/gogo/protobuf/plugin/description",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/embedcheck", "ImportPath": "github.com/gogo/protobuf/plugin/embedcheck",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/enumstringer", "ImportPath": "github.com/gogo/protobuf/plugin/enumstringer",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/equal", "ImportPath": "github.com/gogo/protobuf/plugin/equal",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/face", "ImportPath": "github.com/gogo/protobuf/plugin/face",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/gostring", "ImportPath": "github.com/gogo/protobuf/plugin/gostring",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/marshalto", "ImportPath": "github.com/gogo/protobuf/plugin/marshalto",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck", "ImportPath": "github.com/gogo/protobuf/plugin/oneofcheck",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/populate", "ImportPath": "github.com/gogo/protobuf/plugin/populate",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/size", "ImportPath": "github.com/gogo/protobuf/plugin/size",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/stringer", "ImportPath": "github.com/gogo/protobuf/plugin/stringer",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/testgen", "ImportPath": "github.com/gogo/protobuf/plugin/testgen",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/union", "ImportPath": "github.com/gogo/protobuf/plugin/union",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/plugin/unmarshal", "ImportPath": "github.com/gogo/protobuf/plugin/unmarshal",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/proto", "ImportPath": "github.com/gogo/protobuf/proto",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor", "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/descriptor",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator", "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/generator",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/grpc", "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/grpc",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin", "ImportPath": "github.com/gogo/protobuf/protoc-gen-gogo/plugin",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/sortkeys", "ImportPath": "github.com/gogo/protobuf/sortkeys",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/types", "ImportPath": "github.com/gogo/protobuf/types",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/vanity", "ImportPath": "github.com/gogo/protobuf/vanity",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
"ImportPath": "github.com/gogo/protobuf/vanity/command", "ImportPath": "github.com/gogo/protobuf/vanity/command",
"Comment": "v0.4-3-gc0656ed", "Comment": "v0.4-3-gc0656edd",
"Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7" "Rev": "c0656edd0d9eab7c66d1eb0c568f9039345796f7"
}, },
{ {
@ -2345,82 +2345,82 @@
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer", "ImportPath": "github.com/opencontainers/runc/libcontainer",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/apparmor", "ImportPath": "github.com/opencontainers/runc/libcontainer/apparmor",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups", "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/fs", "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/fs",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/systemd", "ImportPath": "github.com/opencontainers/runc/libcontainer/cgroups/systemd",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/configs", "ImportPath": "github.com/opencontainers/runc/libcontainer/configs",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/configs/validate", "ImportPath": "github.com/opencontainers/runc/libcontainer/configs/validate",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/criurpc", "ImportPath": "github.com/opencontainers/runc/libcontainer/criurpc",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/intelrdt", "ImportPath": "github.com/opencontainers/runc/libcontainer/intelrdt",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/keys", "ImportPath": "github.com/opencontainers/runc/libcontainer/keys",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/mount", "ImportPath": "github.com/opencontainers/runc/libcontainer/mount",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/seccomp", "ImportPath": "github.com/opencontainers/runc/libcontainer/seccomp",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/stacktrace", "ImportPath": "github.com/opencontainers/runc/libcontainer/stacktrace",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/system", "ImportPath": "github.com/opencontainers/runc/libcontainer/system",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/user", "ImportPath": "github.com/opencontainers/runc/libcontainer/user",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
"ImportPath": "github.com/opencontainers/runc/libcontainer/utils", "ImportPath": "github.com/opencontainers/runc/libcontainer/utils",
"Comment": "v1.0.0-rc4-221-g595bea0", "Comment": "v1.0.0-rc4-221-g595bea02",
"Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43" "Rev": "595bea022f077a9e17d7473b34fbaf1adaed9e43"
}, },
{ {
@ -2577,13 +2577,13 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Comment": "v0.0.1-27-g9395926", "Comment": "v0.0.1-32-g6644d46",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/cobra/doc", "ImportPath": "github.com/spf13/cobra/doc",
"Comment": "v0.0.1-27-g9395926", "Comment": "v0.0.1-32-g6644d46",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/jwalterweatherman", "ImportPath": "github.com/spf13/jwalterweatherman",

View File

@ -584,7 +584,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",

View File

@ -268,7 +268,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",

View File

@ -252,7 +252,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/cobra", "ImportPath": "github.com/spf13/cobra",
"Rev": "93959269ad99e80983c9ba742a7e01203a4c0e4f" "Rev": "6644d46b81fa1831979c4cded0106e774e0ef0ab"
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",

View File

@ -21,8 +21,8 @@ const (
func writePreamble(buf *bytes.Buffer, name string) { func writePreamble(buf *bytes.Buffer, name string) {
buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name)) buf.WriteString(fmt.Sprintf("# bash completion for %-36s -*- shell-script -*-\n", name))
buf.WriteString(` buf.WriteString(fmt.Sprintf(`
__debug() __%[1]s_debug()
{ {
if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then if [[ -n ${BASH_COMP_DEBUG_FILE} ]]; then
echo "$*" >> "${BASH_COMP_DEBUG_FILE}" echo "$*" >> "${BASH_COMP_DEBUG_FILE}"
@ -31,13 +31,13 @@ __debug()
# Homebrew on Macs have version 1.3 of bash-completion which doesn't include # 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. # _init_completion. This is a very minimal version of that function.
__my_init_completion() __%[1]s_init_completion()
{ {
COMPREPLY=() COMPREPLY=()
_get_comp_words_by_ref "$@" cur prev words cword _get_comp_words_by_ref "$@" cur prev words cword
} }
__index_of_word() __%[1]s_index_of_word()
{ {
local w word=$1 local w word=$1
shift shift
@ -49,7 +49,7 @@ __index_of_word()
index=-1 index=-1
} }
__contains_word() __%[1]s_contains_word()
{ {
local w word=$1; shift local w word=$1; shift
for w in "$@"; do for w in "$@"; do
@ -58,9 +58,9 @@ __contains_word()
return 1 return 1
} }
__handle_reply() __%[1]s_handle_reply()
{ {
__debug "${FUNCNAME[0]}" __%[1]s_debug "${FUNCNAME[0]}"
case $cur in case $cur in
-*) -*)
if [[ $(type -t compopt) = "builtin" ]]; then if [[ $(type -t compopt) = "builtin" ]]; then
@ -85,7 +85,7 @@ __handle_reply()
local index flag local index flag
flag="${cur%%=*}" flag="${cur%%=*}"
__index_of_word "${flag}" "${flags_with_completion[@]}" __%[1]s_index_of_word "${flag}" "${flags_with_completion[@]}"
COMPREPLY=() COMPREPLY=()
if [[ ${index} -ge 0 ]]; then if [[ ${index} -ge 0 ]]; then
PREFIX="" PREFIX=""
@ -103,7 +103,7 @@ __handle_reply()
# check if we are handling a flag with special work handling # check if we are handling a flag with special work handling
local index local index
__index_of_word "${prev}" "${flags_with_completion[@]}" __%[1]s_index_of_word "${prev}" "${flags_with_completion[@]}"
if [[ ${index} -ge 0 ]]; then if [[ ${index} -ge 0 ]]; then
${flags_completion[${index}]} ${flags_completion[${index}]}
return return
@ -136,24 +136,30 @@ __handle_reply()
if declare -F __ltrim_colon_completions >/dev/null; then if declare -F __ltrim_colon_completions >/dev/null; then
__ltrim_colon_completions "$cur" __ltrim_colon_completions "$cur"
fi 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" # The arguments should be in the form "ext1|ext2|extn"
__handle_filename_extension_flag() __%[1]s_handle_filename_extension_flag()
{ {
local ext="$1" local ext="$1"
_filedir "@(${ext})" _filedir "@(${ext})"
} }
__handle_subdirs_in_dir_flag() __%[1]s_handle_subdirs_in_dir_flag()
{ {
local dir="$1" local dir="$1"
pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1 pushd "${dir}" >/dev/null 2>&1 && _filedir -d && popd >/dev/null 2>&1
} }
__handle_flag() __%[1]s_handle_flag()
{ {
__debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" __%[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() # if a command required a flag, and we found it, unset must_have_one_flag()
local flagname=${words[c]} local flagname=${words[c]}
@ -164,13 +170,13 @@ __handle_flag()
flagname=${flagname%%=*} # strip everything after the = flagname=${flagname%%=*} # strip everything after the =
flagname="${flagname}=" # but put the = back flagname="${flagname}=" # but put the = back
fi fi
__debug "${FUNCNAME[0]}: looking for ${flagname}" __%[1]s_debug "${FUNCNAME[0]}: looking for ${flagname}"
if __contains_word "${flagname}" "${must_have_one_flag[@]}"; then if __%[1]s_contains_word "${flagname}" "${must_have_one_flag[@]}"; then
must_have_one_flag=() must_have_one_flag=()
fi fi
# if you set a flag which only applies to this command, don't show subcommands # if you set a flag which only applies to this command, don't show subcommands
if __contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then if __%[1]s_contains_word "${flagname}" "${local_nonpersistent_flags[@]}"; then
commands=() commands=()
fi fi
@ -187,7 +193,7 @@ __handle_flag()
fi fi
# skip the argument to a two word flag # skip the argument to a two word flag
if __contains_word "${words[c]}" "${two_word_flags[@]}"; then if __%[1]s_contains_word "${words[c]}" "${two_word_flags[@]}"; then
c=$((c+1)) c=$((c+1))
# if we are looking for a flags value, don't show commands # if we are looking for a flags value, don't show commands
if [[ $c -eq $cword ]]; then if [[ $c -eq $cword ]]; then
@ -199,13 +205,13 @@ __handle_flag()
} }
__handle_noun() __%[1]s_handle_noun()
{ {
__debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
if __contains_word "${words[c]}" "${must_have_one_noun[@]}"; then if __%[1]s_contains_word "${words[c]}" "${must_have_one_noun[@]}"; then
must_have_one_noun=() must_have_one_noun=()
elif __contains_word "${words[c]}" "${noun_aliases[@]}"; then elif __%[1]s_contains_word "${words[c]}" "${noun_aliases[@]}"; then
must_have_one_noun=() must_have_one_noun=()
fi fi
@ -213,45 +219,45 @@ __handle_noun()
c=$((c+1)) c=$((c+1))
} }
__handle_command() __%[1]s_handle_command()
{ {
__debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
local next_command local next_command
if [[ -n ${last_command} ]]; then if [[ -n ${last_command} ]]; then
next_command="_${last_command}_${words[c]//:/__}" next_command="_${last_command}_${words[c]//:/__}"
else else
if [[ $c -eq 0 ]]; then if [[ $c -eq 0 ]]; then
next_command="_$(basename "${words[c]//:/__}")" next_command="_%[1]s_root_command"
else else
next_command="_${words[c]//:/__}" next_command="_${words[c]//:/__}"
fi fi
fi fi
c=$((c+1)) c=$((c+1))
__debug "${FUNCNAME[0]}: looking for ${next_command}" __%[1]s_debug "${FUNCNAME[0]}: looking for ${next_command}"
declare -F "$next_command" >/dev/null && $next_command declare -F "$next_command" >/dev/null && $next_command
} }
__handle_word() __%[1]s_handle_word()
{ {
if [[ $c -ge $cword ]]; then if [[ $c -ge $cword ]]; then
__handle_reply __%[1]s_handle_reply
return return
fi fi
__debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}" __%[1]s_debug "${FUNCNAME[0]}: c is $c words[c] is ${words[c]}"
if [[ "${words[c]}" == -* ]]; then if [[ "${words[c]}" == -* ]]; then
__handle_flag __%[1]s_handle_flag
elif __contains_word "${words[c]}" "${commands[@]}"; then elif __%[1]s_contains_word "${words[c]}" "${commands[@]}"; then
__handle_command __%[1]s_handle_command
elif [[ $c -eq 0 ]] && __contains_word "$(basename "${words[c]}")" "${commands[@]}"; then elif [[ $c -eq 0 ]]; then
__handle_command __%[1]s_handle_command
else else
__handle_noun __%[1]s_handle_noun
fi fi
__handle_word __%[1]s_handle_word
} }
`) `, name))
} }
func writePostscript(buf *bytes.Buffer, name string) { func writePostscript(buf *bytes.Buffer, name string) {
@ -263,7 +269,7 @@ func writePostscript(buf *bytes.Buffer, name string) {
if declare -F _init_completion >/dev/null 2>&1; then if declare -F _init_completion >/dev/null 2>&1; then
_init_completion -s || return _init_completion -s || return
else else
__my_init_completion -n "=" || return __%[1]s_init_completion -n "=" || return
fi fi
local c=0 local c=0
@ -272,13 +278,13 @@ func writePostscript(buf *bytes.Buffer, name string) {
local local_nonpersistent_flags=() local local_nonpersistent_flags=()
local flags_with_completion=() local flags_with_completion=()
local flags_completion=() local flags_completion=()
local commands=("%s") local commands=("%[1]s")
local must_have_one_flag=() local must_have_one_flag=()
local must_have_one_noun=() local must_have_one_noun=()
local last_command local last_command
local nouns=() local nouns=()
__handle_word __%[1]s_handle_word
} }
`, name)) `, name))
@ -303,7 +309,7 @@ func writeCommands(buf *bytes.Buffer, cmd *Command) {
buf.WriteString("\n") buf.WriteString("\n")
} }
func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string) { func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]string, cmd *Command) {
for key, value := range annotations { for key, value := range annotations {
switch key { switch key {
case BashCompFilenameExt: case BashCompFilenameExt:
@ -311,7 +317,7 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s
var ext string var ext string
if len(value) > 0 { if len(value) > 0 {
ext = "__handle_filename_extension_flag " + strings.Join(value, "|") ext = fmt.Sprintf("__%s_handle_filename_extension_flag ", cmd.Root().Name()) + strings.Join(value, "|")
} else { } else {
ext = "_filedir" ext = "_filedir"
} }
@ -329,7 +335,7 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s
var ext string var ext string
if len(value) == 1 { if len(value) == 1 {
ext = "__handle_subdirs_in_dir_flag " + value[0] ext = fmt.Sprintf("__%s_handle_subdirs_in_dir_flag ", cmd.Root().Name()) + value[0]
} else { } else {
ext = "_filedir -d" ext = "_filedir -d"
} }
@ -338,7 +344,7 @@ func writeFlagHandler(buf *bytes.Buffer, name string, annotations map[string][]s
} }
} }
func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag) { func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) {
name := flag.Shorthand name := flag.Shorthand
format := " " format := " "
if len(flag.NoOptDefVal) == 0 { if len(flag.NoOptDefVal) == 0 {
@ -346,10 +352,10 @@ func writeShortFlag(buf *bytes.Buffer, flag *pflag.Flag) {
} }
format += "flags+=(\"-%s\")\n" format += "flags+=(\"-%s\")\n"
buf.WriteString(fmt.Sprintf(format, name)) buf.WriteString(fmt.Sprintf(format, name))
writeFlagHandler(buf, "-"+name, flag.Annotations) writeFlagHandler(buf, "-"+name, flag.Annotations, cmd)
} }
func writeFlag(buf *bytes.Buffer, flag *pflag.Flag) { func writeFlag(buf *bytes.Buffer, flag *pflag.Flag, cmd *Command) {
name := flag.Name name := flag.Name
format := " flags+=(\"--%s" format := " flags+=(\"--%s"
if len(flag.NoOptDefVal) == 0 { if len(flag.NoOptDefVal) == 0 {
@ -357,7 +363,7 @@ func writeFlag(buf *bytes.Buffer, flag *pflag.Flag) {
} }
format += "\")\n" format += "\")\n"
buf.WriteString(fmt.Sprintf(format, name)) buf.WriteString(fmt.Sprintf(format, name))
writeFlagHandler(buf, "--"+name, flag.Annotations) writeFlagHandler(buf, "--"+name, flag.Annotations, cmd)
} }
func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) { func writeLocalNonPersistentFlag(buf *bytes.Buffer, flag *pflag.Flag) {
@ -383,9 +389,9 @@ func writeFlags(buf *bytes.Buffer, cmd *Command) {
if nonCompletableFlag(flag) { if nonCompletableFlag(flag) {
return return
} }
writeFlag(buf, flag) writeFlag(buf, flag, cmd)
if len(flag.Shorthand) > 0 { if len(flag.Shorthand) > 0 {
writeShortFlag(buf, flag) writeShortFlag(buf, flag, cmd)
} }
if localNonPersistentFlags.Lookup(flag.Name) != nil { if localNonPersistentFlags.Lookup(flag.Name) != nil {
writeLocalNonPersistentFlag(buf, flag) writeLocalNonPersistentFlag(buf, flag)
@ -395,9 +401,9 @@ func writeFlags(buf *bytes.Buffer, cmd *Command) {
if nonCompletableFlag(flag) { if nonCompletableFlag(flag) {
return return
} }
writeFlag(buf, flag) writeFlag(buf, flag, cmd)
if len(flag.Shorthand) > 0 { if len(flag.Shorthand) > 0 {
writeShortFlag(buf, flag) writeShortFlag(buf, flag, cmd)
} }
}) })
@ -455,7 +461,13 @@ func gen(buf *bytes.Buffer, cmd *Command) {
commandName := cmd.CommandPath() commandName := cmd.CommandPath()
commandName = strings.Replace(commandName, " ", "_", -1) commandName = strings.Replace(commandName, " ", "_", -1)
commandName = strings.Replace(commandName, ":", "__", -1) commandName = strings.Replace(commandName, ":", "__", -1)
buf.WriteString(fmt.Sprintf("_%s()\n{\n", commandName))
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(fmt.Sprintf(" last_command=%q\n", commandName))
writeCommands(buf, cmd) writeCommands(buf, cmd)
writeFlags(buf, cmd) writeFlags(buf, cmd)

View File

@ -204,3 +204,17 @@ __kubectl_get_namespaces()
fi fi
} }
``` ```
# Using bash aliases for commands
You can also configure the `bash aliases` for the commands and they will also support completions.
```bash
alias aliasname=origcommand
complete -o default -F __start_origcommand aliasname
# and now when you run `aliasname` completion will make
# suggestions as it did for `origcommand`.
$) aliasname <tab><tab>
completion firstcommand secondcommand
```