Merge pull request #53631 from dixudx/enforce_cobra_required_flags

Automatic merge from submit-queue. If you want to cherry-pick this change to another branch, please follow the instructions <a href="https://github.com/kubernetes/community/blob/master/contributors/devel/cherry-picks.md">here</a>.

update vendor spf13/cobra to enforce required flags

**What this PR does / why we need it**:

spf13/cobra#502 has enforced checking flags that marked as required, an error will be raised if unset.

**Which issue this PR fixes** *(optional, in `fixes #<issue number>(, fixes #<issue_number>, ...)` format, will close that issue when PR gets merged)*:fixes #54855
xref #48400
fixes kubernetes/kubectl#121

**Special notes for your reviewer**:
/assign @liggitt @eparis

**Release note**:

```release-note
kubectl now enforces required flags at a more fundamental level
```

Kubernetes-commit: 048757b8a51333f59d3112d2b228d2f0102a4afc
This commit is contained in:
Kubernetes Publisher 2018-01-18 02:00:27 -08:00
commit 4a1ec65955
6 changed files with 507 additions and 303 deletions

374
Godeps/Godeps.json generated
View File

@ -92,7 +92,7 @@
}, },
{ {
"ImportPath": "github.com/spf13/pflag", "ImportPath": "github.com/spf13/pflag",
"Rev": "9ff6c6923cfffbcd502984b8e0c80539a94968b7" "Rev": "4c012f6dcd9546820e378d0bdda4d8fc772cdfea"
}, },
{ {
"ImportPath": "golang.org/x/crypto/ssh/terminal", "ImportPath": "golang.org/x/crypto/ssh/terminal",
@ -152,747 +152,747 @@
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1alpha1", "ImportPath": "k8s.io/api/admissionregistration/v1alpha1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/admissionregistration/v1beta1", "ImportPath": "k8s.io/api/admissionregistration/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1", "ImportPath": "k8s.io/api/apps/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta1", "ImportPath": "k8s.io/api/apps/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/apps/v1beta2", "ImportPath": "k8s.io/api/apps/v1beta2",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1", "ImportPath": "k8s.io/api/authentication/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/authentication/v1beta1", "ImportPath": "k8s.io/api/authentication/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1", "ImportPath": "k8s.io/api/authorization/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/authorization/v1beta1", "ImportPath": "k8s.io/api/authorization/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v1", "ImportPath": "k8s.io/api/autoscaling/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/autoscaling/v2beta1", "ImportPath": "k8s.io/api/autoscaling/v2beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1", "ImportPath": "k8s.io/api/batch/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v1beta1", "ImportPath": "k8s.io/api/batch/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/batch/v2alpha1", "ImportPath": "k8s.io/api/batch/v2alpha1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/certificates/v1beta1", "ImportPath": "k8s.io/api/certificates/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/core/v1", "ImportPath": "k8s.io/api/core/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/events/v1beta1", "ImportPath": "k8s.io/api/events/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/extensions/v1beta1", "ImportPath": "k8s.io/api/extensions/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/networking/v1", "ImportPath": "k8s.io/api/networking/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/policy/v1beta1", "ImportPath": "k8s.io/api/policy/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1", "ImportPath": "k8s.io/api/rbac/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1alpha1", "ImportPath": "k8s.io/api/rbac/v1alpha1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/rbac/v1beta1", "ImportPath": "k8s.io/api/rbac/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/scheduling/v1alpha1", "ImportPath": "k8s.io/api/scheduling/v1alpha1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/settings/v1alpha1", "ImportPath": "k8s.io/api/settings/v1alpha1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1", "ImportPath": "k8s.io/api/storage/v1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1alpha1", "ImportPath": "k8s.io/api/storage/v1alpha1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/api/storage/v1beta1", "ImportPath": "k8s.io/api/storage/v1beta1",
"Rev": "17e8c4ddcf485c837950b38d9509bfcadfd0c8e1" "Rev": "e81ae94485e04294ce22cc89b480edb2a4f7f575"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/errors", "ImportPath": "k8s.io/apimachinery/pkg/api/errors",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/meta", "ImportPath": "k8s.io/apimachinery/pkg/api/meta",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/api/resource", "ImportPath": "k8s.io/apimachinery/pkg/api/resource",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/internalversion",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1/unstructured",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1", "ImportPath": "k8s.io/apimachinery/pkg/apis/meta/v1alpha1",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion", "ImportPath": "k8s.io/apimachinery/pkg/conversion",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams", "ImportPath": "k8s.io/apimachinery/pkg/conversion/queryparams",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/fields", "ImportPath": "k8s.io/apimachinery/pkg/fields",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/labels", "ImportPath": "k8s.io/apimachinery/pkg/labels",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime", "ImportPath": "k8s.io/apimachinery/pkg/runtime",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/schema", "ImportPath": "k8s.io/apimachinery/pkg/runtime/schema",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/json",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/protobuf",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/recognizer",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/streaming",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning", "ImportPath": "k8s.io/apimachinery/pkg/runtime/serializer/versioning",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/selection", "ImportPath": "k8s.io/apimachinery/pkg/selection",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/types", "ImportPath": "k8s.io/apimachinery/pkg/types",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/cache", "ImportPath": "k8s.io/apimachinery/pkg/util/cache",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/clock", "ImportPath": "k8s.io/apimachinery/pkg/util/clock",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/diff", "ImportPath": "k8s.io/apimachinery/pkg/util/diff",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/errors", "ImportPath": "k8s.io/apimachinery/pkg/util/errors",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/framer", "ImportPath": "k8s.io/apimachinery/pkg/util/framer",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/intstr", "ImportPath": "k8s.io/apimachinery/pkg/util/intstr",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/json", "ImportPath": "k8s.io/apimachinery/pkg/util/json",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch", "ImportPath": "k8s.io/apimachinery/pkg/util/mergepatch",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/net", "ImportPath": "k8s.io/apimachinery/pkg/util/net",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/runtime", "ImportPath": "k8s.io/apimachinery/pkg/util/runtime",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/sets", "ImportPath": "k8s.io/apimachinery/pkg/util/sets",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch", "ImportPath": "k8s.io/apimachinery/pkg/util/strategicpatch",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation", "ImportPath": "k8s.io/apimachinery/pkg/util/validation",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/validation/field", "ImportPath": "k8s.io/apimachinery/pkg/util/validation/field",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/wait", "ImportPath": "k8s.io/apimachinery/pkg/util/wait",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/util/yaml", "ImportPath": "k8s.io/apimachinery/pkg/util/yaml",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/version", "ImportPath": "k8s.io/apimachinery/pkg/version",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/pkg/watch", "ImportPath": "k8s.io/apimachinery/pkg/watch",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/json",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect", "ImportPath": "k8s.io/apimachinery/third_party/forked/golang/reflect",
"Rev": "bc918d4f73e11cb3110730ec8e8ee02c58d6267c" "Rev": "baafc3365acf1aa0c6c9c9aa169340d9fc2d3c6c"
}, },
{ {
"ImportPath": "k8s.io/client-go/discovery", "ImportPath": "k8s.io/client-go/discovery",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/discovery/fake", "ImportPath": "k8s.io/client-go/discovery/fake",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers", "ImportPath": "k8s.io/client-go/informers",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/admissionregistration", "ImportPath": "k8s.io/client-go/informers/admissionregistration",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/admissionregistration/v1alpha1", "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/admissionregistration/v1beta1", "ImportPath": "k8s.io/client-go/informers/admissionregistration/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/apps", "ImportPath": "k8s.io/client-go/informers/apps",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/apps/v1", "ImportPath": "k8s.io/client-go/informers/apps/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/apps/v1beta1", "ImportPath": "k8s.io/client-go/informers/apps/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/apps/v1beta2", "ImportPath": "k8s.io/client-go/informers/apps/v1beta2",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/autoscaling", "ImportPath": "k8s.io/client-go/informers/autoscaling",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/autoscaling/v1", "ImportPath": "k8s.io/client-go/informers/autoscaling/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1", "ImportPath": "k8s.io/client-go/informers/autoscaling/v2beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/batch", "ImportPath": "k8s.io/client-go/informers/batch",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/batch/v1", "ImportPath": "k8s.io/client-go/informers/batch/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/batch/v1beta1", "ImportPath": "k8s.io/client-go/informers/batch/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/batch/v2alpha1", "ImportPath": "k8s.io/client-go/informers/batch/v2alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/certificates", "ImportPath": "k8s.io/client-go/informers/certificates",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/certificates/v1beta1", "ImportPath": "k8s.io/client-go/informers/certificates/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/core", "ImportPath": "k8s.io/client-go/informers/core",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/core/v1", "ImportPath": "k8s.io/client-go/informers/core/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/events", "ImportPath": "k8s.io/client-go/informers/events",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/events/v1beta1", "ImportPath": "k8s.io/client-go/informers/events/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/extensions", "ImportPath": "k8s.io/client-go/informers/extensions",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/extensions/v1beta1", "ImportPath": "k8s.io/client-go/informers/extensions/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/internalinterfaces", "ImportPath": "k8s.io/client-go/informers/internalinterfaces",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/networking", "ImportPath": "k8s.io/client-go/informers/networking",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/networking/v1", "ImportPath": "k8s.io/client-go/informers/networking/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/policy", "ImportPath": "k8s.io/client-go/informers/policy",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/policy/v1beta1", "ImportPath": "k8s.io/client-go/informers/policy/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/rbac", "ImportPath": "k8s.io/client-go/informers/rbac",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/rbac/v1", "ImportPath": "k8s.io/client-go/informers/rbac/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/rbac/v1alpha1", "ImportPath": "k8s.io/client-go/informers/rbac/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/rbac/v1beta1", "ImportPath": "k8s.io/client-go/informers/rbac/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/scheduling", "ImportPath": "k8s.io/client-go/informers/scheduling",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/scheduling/v1alpha1", "ImportPath": "k8s.io/client-go/informers/scheduling/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/settings", "ImportPath": "k8s.io/client-go/informers/settings",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/settings/v1alpha1", "ImportPath": "k8s.io/client-go/informers/settings/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/storage", "ImportPath": "k8s.io/client-go/informers/storage",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/storage/v1", "ImportPath": "k8s.io/client-go/informers/storage/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/storage/v1alpha1", "ImportPath": "k8s.io/client-go/informers/storage/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/informers/storage/v1beta1", "ImportPath": "k8s.io/client-go/informers/storage/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes", "ImportPath": "k8s.io/client-go/kubernetes",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/scheme", "ImportPath": "k8s.io/client-go/kubernetes/scheme",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1", "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/admissionregistration/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2", "ImportPath": "k8s.io/client-go/kubernetes/typed/apps/v1beta2",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/authentication/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/authorization/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/autoscaling/v2beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1", "ImportPath": "k8s.io/client-go/kubernetes/typed/batch/v2alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/certificates/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/core/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/events/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/events/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/extensions/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/networking/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/policy/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1", "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/rbac/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1", "ImportPath": "k8s.io/client-go/kubernetes/typed/scheduling/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1", "ImportPath": "k8s.io/client-go/kubernetes/typed/settings/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1", "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1alpha1", "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1", "ImportPath": "k8s.io/client-go/kubernetes/typed/storage/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/admissionregistration/v1alpha1", "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/admissionregistration/v1beta1", "ImportPath": "k8s.io/client-go/listers/admissionregistration/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/apps/v1", "ImportPath": "k8s.io/client-go/listers/apps/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/apps/v1beta1", "ImportPath": "k8s.io/client-go/listers/apps/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/apps/v1beta2", "ImportPath": "k8s.io/client-go/listers/apps/v1beta2",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/autoscaling/v1", "ImportPath": "k8s.io/client-go/listers/autoscaling/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1", "ImportPath": "k8s.io/client-go/listers/autoscaling/v2beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/batch/v1", "ImportPath": "k8s.io/client-go/listers/batch/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/batch/v1beta1", "ImportPath": "k8s.io/client-go/listers/batch/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/batch/v2alpha1", "ImportPath": "k8s.io/client-go/listers/batch/v2alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/certificates/v1beta1", "ImportPath": "k8s.io/client-go/listers/certificates/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/core/v1", "ImportPath": "k8s.io/client-go/listers/core/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/events/v1beta1", "ImportPath": "k8s.io/client-go/listers/events/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/extensions/v1beta1", "ImportPath": "k8s.io/client-go/listers/extensions/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/networking/v1", "ImportPath": "k8s.io/client-go/listers/networking/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/policy/v1beta1", "ImportPath": "k8s.io/client-go/listers/policy/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/rbac/v1", "ImportPath": "k8s.io/client-go/listers/rbac/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/rbac/v1alpha1", "ImportPath": "k8s.io/client-go/listers/rbac/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/rbac/v1beta1", "ImportPath": "k8s.io/client-go/listers/rbac/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/scheduling/v1alpha1", "ImportPath": "k8s.io/client-go/listers/scheduling/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/settings/v1alpha1", "ImportPath": "k8s.io/client-go/listers/settings/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/storage/v1", "ImportPath": "k8s.io/client-go/listers/storage/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/storage/v1alpha1", "ImportPath": "k8s.io/client-go/listers/storage/v1alpha1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/listers/storage/v1beta1", "ImportPath": "k8s.io/client-go/listers/storage/v1beta1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/pkg/version", "ImportPath": "k8s.io/client-go/pkg/version",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/rest", "ImportPath": "k8s.io/client-go/rest",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/rest/watch", "ImportPath": "k8s.io/client-go/rest/watch",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/testing", "ImportPath": "k8s.io/client-go/testing",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/auth", "ImportPath": "k8s.io/client-go/tools/auth",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/cache", "ImportPath": "k8s.io/client-go/tools/cache",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/clientcmd", "ImportPath": "k8s.io/client-go/tools/clientcmd",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/clientcmd/api", "ImportPath": "k8s.io/client-go/tools/clientcmd/api",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/clientcmd/api/latest", "ImportPath": "k8s.io/client-go/tools/clientcmd/api/latest",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1", "ImportPath": "k8s.io/client-go/tools/clientcmd/api/v1",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/metrics", "ImportPath": "k8s.io/client-go/tools/metrics",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/pager", "ImportPath": "k8s.io/client-go/tools/pager",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/record", "ImportPath": "k8s.io/client-go/tools/record",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/tools/reference", "ImportPath": "k8s.io/client-go/tools/reference",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/transport", "ImportPath": "k8s.io/client-go/transport",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/util/buffer", "ImportPath": "k8s.io/client-go/util/buffer",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/util/cert", "ImportPath": "k8s.io/client-go/util/cert",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/util/flowcontrol", "ImportPath": "k8s.io/client-go/util/flowcontrol",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/util/homedir", "ImportPath": "k8s.io/client-go/util/homedir",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/util/integer", "ImportPath": "k8s.io/client-go/util/integer",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/client-go/util/workqueue", "ImportPath": "k8s.io/client-go/util/workqueue",
"Rev": "e9556070fb13ce356af1ae66fd7f77e1b5815338" "Rev": "8a28689b296bec0a8a7a422043195a2251386977"
}, },
{ {
"ImportPath": "k8s.io/kube-openapi/pkg/util/proto", "ImportPath": "k8s.io/kube-openapi/pkg/util/proto",

View File

@ -3,18 +3,19 @@ sudo: false
language: go language: go
go: go:
- 1.6.3 - 1.7.3
- 1.7.3 - 1.8.1
- tip - tip
matrix: matrix:
allow_failures: allow_failures:
- go: tip - go: tip
install: install:
- go get github.com/golang/lint/golint - go get github.com/golang/lint/golint
- export PATH=$GOPATH/bin:$PATH - export PATH=$GOPATH/bin:$PATH
- go install ./... - go install ./...
script: script:
- verify/all.sh -v - verify/all.sh -v
- go test ./... - go test ./...

View File

@ -246,6 +246,25 @@ It is possible to mark a flag as hidden, meaning it will still function as norma
flags.MarkHidden("secretFlag") flags.MarkHidden("secretFlag")
``` ```
## Disable sorting of flags
`pflag` allows you to disable sorting of flags for help and usage message.
**Example**:
```go
flags.BoolP("verbose", "v", false, "verbose output")
flags.String("coolflag", "yeaah", "it's really cool flag")
flags.Int("usefulflag", 777, "sometimes it's very useful")
flags.SortFlags = false
flags.PrintDefaults()
```
**Output**:
```
-v, --verbose verbose output
--coolflag string it's really cool flag (default "yeaah")
--usefulflag int sometimes it's very useful (default 777)
```
## Supporting Go flags when using pflag ## Supporting Go flags when using pflag
In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary In order to support flags defined using Go's `flag` package, they must be added to the `pflag` flagset. This is usually necessary
to support flags defined by third-party dependencies (e.g. `golang/glog`). to support flags defined by third-party dependencies (e.g. `golang/glog`).
@ -270,8 +289,8 @@ func main() {
You can see the full reference documentation of the pflag package You can see the full reference documentation of the pflag package
[at godoc.org][3], or through go's standard documentation system by [at godoc.org][3], or through go's standard documentation system by
running `godoc -http=:6060` and browsing to running `godoc -http=:6060` and browsing to
[http://localhost:6060/pkg/github.com/ogier/pflag][2] after [http://localhost:6060/pkg/github.com/spf13/pflag][2] after
installation. installation.
[2]: http://localhost:6060/pkg/github.com/ogier/pflag [2]: http://localhost:6060/pkg/github.com/spf13/pflag
[3]: http://godoc.org/github.com/ogier/pflag [3]: http://godoc.org/github.com/spf13/pflag

View File

@ -11,13 +11,13 @@ func newCountValue(val int, p *int) *countValue {
} }
func (i *countValue) Set(s string) error { func (i *countValue) Set(s string) error {
v, err := strconv.ParseInt(s, 0, 64) // "+1" means that no specific value was passed, so increment
// -1 means that no specific value was passed, so increment if s == "+1" {
if v == -1 {
*i = countValue(*i + 1) *i = countValue(*i + 1)
} else { return nil
*i = countValue(v)
} }
v, err := strconv.ParseInt(s, 0, 0)
*i = countValue(v)
return err return err
} }
@ -54,7 +54,7 @@ func (f *FlagSet) CountVar(p *int, name string, usage string) {
// CountVarP is like CountVar only take a shorthand for the flag name. // CountVarP is like CountVar only take a shorthand for the flag name.
func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) { func (f *FlagSet) CountVarP(p *int, name, shorthand string, usage string) {
flag := f.VarPF(newCountValue(0, p), name, shorthand, usage) flag := f.VarPF(newCountValue(0, p), name, shorthand, usage)
flag.NoOptDefVal = "-1" flag.NoOptDefVal = "+1"
} }
// CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set // CountVar like CountVar only the flag is placed on the CommandLine instead of a given flag set
@ -83,7 +83,9 @@ func (f *FlagSet) CountP(name, shorthand string, usage string) *int {
return p return p
} }
// Count like Count only the flag is placed on the CommandLine isntead of a given flag set // 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 { func Count(name string, usage string) *int {
return CommandLine.CountP(name, "", usage) return CommandLine.CountP(name, "", usage)
} }

286
vendor/github.com/spf13/pflag/flag.go generated vendored
View File

@ -16,9 +16,9 @@ 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 pflag under the name "flag" then all code should continue to function
with no changes. with no changes.
import flag "github.com/ogier/pflag" import flag "github.com/spf13/pflag"
There is one exception to this: if you directly instantiate the Flag struct 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. there is one more field "Shorthand" that you will need to set.
Most code never instantiates this struct directly, and instead uses Most code never instantiates this struct directly, and instead uses
functions such as String(), BoolVar(), and Var(), and is therefore functions such as String(), BoolVar(), and Var(), and is therefore
@ -134,14 +134,21 @@ type FlagSet struct {
// a custom error handler. // a custom error handler.
Usage func() Usage func()
// SortFlags is used to indicate, if user wants to have sorted flags in
// help/usage messages.
SortFlags bool
name string name string
parsed bool parsed bool
actual map[NormalizedName]*Flag actual map[NormalizedName]*Flag
orderedActual []*Flag
sortedActual []*Flag
formal map[NormalizedName]*Flag formal map[NormalizedName]*Flag
orderedFormal []*Flag
sortedFormal []*Flag
shorthands map[byte]*Flag shorthands map[byte]*Flag
args []string // arguments after flags args []string // arguments after flags
argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no -- argsLenAtDash int // len(args) when a '--' was located when parsing, or -1 if no --
exitOnError bool // does the program exit if there's an error?
errorHandling ErrorHandling errorHandling ErrorHandling
output io.Writer // nil means stderr; use out() accessor output io.Writer // nil means stderr; use out() accessor
interspersed bool // allow interspersed option/non-option args interspersed bool // allow interspersed option/non-option args
@ -156,7 +163,7 @@ type Flag struct {
Value Value // value as set Value Value // value as set
DefValue string // default value (as text); for usage message DefValue string // default value (as text); for usage message
Changed bool // If the user set the value (or if left to default) 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 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 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 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 ShorthandDeprecated string // If the shorthand of this flag is deprecated, this string is the new or now thing to use
@ -194,11 +201,19 @@ func sortFlags(flags map[NormalizedName]*Flag) []*Flag {
// "--getUrl" which may also be translated to "geturl" and everything will work. // "--getUrl" which may also be translated to "geturl" and everything will work.
func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) { func (f *FlagSet) SetNormalizeFunc(n func(f *FlagSet, name string) NormalizedName) {
f.normalizeNameFunc = n f.normalizeNameFunc = n
for k, v := range f.formal { f.sortedFormal = f.sortedFormal[:0]
delete(f.formal, k) for fname, flag := range f.formal {
nname := f.normalizeFlagName(string(k)) nname := f.normalizeFlagName(flag.Name)
f.formal[nname] = v if fname == nname {
v.Name = string(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
}
} }
} }
@ -229,10 +244,25 @@ func (f *FlagSet) SetOutput(output io.Writer) {
f.output = output f.output = output
} }
// VisitAll visits the flags in lexicographical order, calling fn for each. // 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. // It visits all flags, even those not set.
func (f *FlagSet) VisitAll(fn func(*Flag)) { func (f *FlagSet) VisitAll(fn func(*Flag)) {
for _, flag := range sortFlags(f.formal) { 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) fn(flag)
} }
} }
@ -253,22 +283,39 @@ func (f *FlagSet) HasAvailableFlags() bool {
return false return false
} }
// VisitAll visits the command-line flags in lexicographical order, calling // VisitAll visits the command-line flags in lexicographical order or
// fn for each. It visits all flags, even those not set. // 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)) { func VisitAll(fn func(*Flag)) {
CommandLine.VisitAll(fn) CommandLine.VisitAll(fn)
} }
// Visit visits the flags in lexicographical order, calling fn for each. // 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. // It visits only those flags that have been set.
func (f *FlagSet) Visit(fn func(*Flag)) { func (f *FlagSet) Visit(fn func(*Flag)) {
for _, flag := range sortFlags(f.actual) { 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) fn(flag)
} }
} }
// Visit visits the command-line flags in lexicographical order, calling fn // Visit visits the command-line flags in lexicographical order or
// for each. It visits only those flags that have been set. // 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)) { func Visit(fn func(*Flag)) {
CommandLine.Visit(fn) CommandLine.Visit(fn)
} }
@ -278,6 +325,22 @@ func (f *FlagSet) Lookup(name string) *Flag {
return f.lookup(f.normalizeFlagName(name)) 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. // lookup returns the Flag structure of the named flag, returning nil if none exists.
func (f *FlagSet) lookup(name NormalizedName) *Flag { func (f *FlagSet) lookup(name NormalizedName) *Flag {
return f.formal[name] return f.formal[name]
@ -319,7 +382,7 @@ func (f *FlagSet) MarkDeprecated(name string, usageMessage string) error {
if flag == nil { if flag == nil {
return fmt.Errorf("flag %q does not exist", name) return fmt.Errorf("flag %q does not exist", name)
} }
if len(usageMessage) == 0 { if usageMessage == "" {
return fmt.Errorf("deprecated message for flag %q must be set", name) return fmt.Errorf("deprecated message for flag %q must be set", name)
} }
flag.Deprecated = usageMessage flag.Deprecated = usageMessage
@ -334,7 +397,7 @@ func (f *FlagSet) MarkShorthandDeprecated(name string, usageMessage string) erro
if flag == nil { if flag == nil {
return fmt.Errorf("flag %q does not exist", name) return fmt.Errorf("flag %q does not exist", name)
} }
if len(usageMessage) == 0 { if usageMessage == "" {
return fmt.Errorf("deprecated message for flag %q must be set", name) return fmt.Errorf("deprecated message for flag %q must be set", name)
} }
flag.ShorthandDeprecated = usageMessage flag.ShorthandDeprecated = usageMessage
@ -358,6 +421,12 @@ func Lookup(name string) *Flag {
return CommandLine.Lookup(name) 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. // Set sets the value of the named flag.
func (f *FlagSet) Set(name, value string) error { func (f *FlagSet) Set(name, value string) error {
normalName := f.normalizeFlagName(name) normalName := f.normalizeFlagName(name)
@ -365,17 +434,30 @@ func (f *FlagSet) Set(name, value string) error {
if !ok { if !ok {
return fmt.Errorf("no such flag -%v", name) return fmt.Errorf("no such flag -%v", name)
} }
err := flag.Value.Set(value) err := flag.Value.Set(value)
if err != nil { if err != nil {
return err 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 f.actual == nil {
f.actual = make(map[NormalizedName]*Flag) 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
} }
f.actual[normalName] = flag
flag.Changed = true if flag.Deprecated != "" {
if len(flag.Deprecated) > 0 { fmt.Fprintf(f.out(), "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
} }
return nil return nil
} }
@ -482,6 +564,14 @@ func UnquoteUsage(flag *Flag) (name string, usage string) {
name = "int" name = "int"
case "uint64": case "uint64":
name = "uint" name = "uint"
case "stringSlice":
name = "strings"
case "intSlice":
name = "ints"
case "uintSlice":
name = "uints"
case "boolSlice":
name = "bools"
} }
return return
@ -557,28 +647,28 @@ func wrap(i, w int, s string) string {
// for all flags in the FlagSet. Wrapped to `cols` columns (0 for no // for all flags in the FlagSet. Wrapped to `cols` columns (0 for no
// wrapping) // wrapping)
func (f *FlagSet) FlagUsagesWrapped(cols int) string { func (f *FlagSet) FlagUsagesWrapped(cols int) string {
x := new(bytes.Buffer) buf := new(bytes.Buffer)
lines := make([]string, 0, len(f.formal)) lines := make([]string, 0, len(f.formal))
maxlen := 0 maxlen := 0
f.VisitAll(func(flag *Flag) { f.VisitAll(func(flag *Flag) {
if len(flag.Deprecated) > 0 || flag.Hidden { if flag.Deprecated != "" || flag.Hidden {
return return
} }
line := "" line := ""
if len(flag.Shorthand) > 0 && len(flag.ShorthandDeprecated) == 0 { if flag.Shorthand != "" && flag.ShorthandDeprecated == "" {
line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name) line = fmt.Sprintf(" -%s, --%s", flag.Shorthand, flag.Name)
} else { } else {
line = fmt.Sprintf(" --%s", flag.Name) line = fmt.Sprintf(" --%s", flag.Name)
} }
varname, usage := UnquoteUsage(flag) varname, usage := UnquoteUsage(flag)
if len(varname) > 0 { if varname != "" {
line += " " + varname line += " " + varname
} }
if len(flag.NoOptDefVal) > 0 { if flag.NoOptDefVal != "" {
switch flag.Value.Type() { switch flag.Value.Type() {
case "string": case "string":
line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal) line += fmt.Sprintf("[=\"%s\"]", flag.NoOptDefVal)
@ -586,6 +676,10 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string {
if flag.NoOptDefVal != "true" { if flag.NoOptDefVal != "true" {
line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
} }
case "count":
if flag.NoOptDefVal != "+1" {
line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
}
default: default:
line += fmt.Sprintf("[=%s]", flag.NoOptDefVal) line += fmt.Sprintf("[=%s]", flag.NoOptDefVal)
} }
@ -601,7 +695,7 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string {
line += usage line += usage
if !flag.defaultIsZeroValue() { if !flag.defaultIsZeroValue() {
if flag.Value.Type() == "string" { if flag.Value.Type() == "string" {
line += fmt.Sprintf(" (default \"%s\")", flag.DefValue) line += fmt.Sprintf(" (default %q)", flag.DefValue)
} else { } else {
line += fmt.Sprintf(" (default %s)", flag.DefValue) line += fmt.Sprintf(" (default %s)", flag.DefValue)
} }
@ -614,10 +708,10 @@ func (f *FlagSet) FlagUsagesWrapped(cols int) string {
sidx := strings.Index(line, "\x00") sidx := strings.Index(line, "\x00")
spacing := strings.Repeat(" ", maxlen-sidx) spacing := strings.Repeat(" ", maxlen-sidx)
// maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx // maxlen + 2 comes from + 1 for the \x00 and + 1 for the (deliberate) off-by-one in maxlen-sidx
fmt.Fprintln(x, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:])) fmt.Fprintln(buf, line[:sidx], spacing, wrap(maxlen+2, cols, line[sidx+1:]))
} }
return x.String() return buf.String()
} }
// FlagUsages returns a string containing the usage information for all flags in // FlagUsages returns a string containing the usage information for all flags in
@ -714,11 +808,10 @@ func (f *FlagSet) VarP(value Value, name, shorthand, usage string) {
// AddFlag will add the flag to the FlagSet // AddFlag will add the flag to the FlagSet
func (f *FlagSet) AddFlag(flag *Flag) { func (f *FlagSet) AddFlag(flag *Flag) {
// Call normalizeFlagName function only once
normalizedFlagName := f.normalizeFlagName(flag.Name) normalizedFlagName := f.normalizeFlagName(flag.Name)
_, alreadythere := f.formal[normalizedFlagName] _, alreadyThere := f.formal[normalizedFlagName]
if alreadythere { if alreadyThere {
msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name) msg := fmt.Sprintf("%s flag redefined: %s", f.name, flag.Name)
fmt.Fprintln(f.out(), msg) fmt.Fprintln(f.out(), msg)
panic(msg) // Happens only if flags are declared with identical names panic(msg) // Happens only if flags are declared with identical names
@ -729,28 +822,31 @@ func (f *FlagSet) AddFlag(flag *Flag) {
flag.Name = string(normalizedFlagName) flag.Name = string(normalizedFlagName)
f.formal[normalizedFlagName] = flag f.formal[normalizedFlagName] = flag
f.orderedFormal = append(f.orderedFormal, flag)
if len(flag.Shorthand) == 0 { if flag.Shorthand == "" {
return return
} }
if len(flag.Shorthand) > 1 { if len(flag.Shorthand) > 1 {
fmt.Fprintf(f.out(), "%s shorthand more than ASCII character: %s\n", f.name, flag.Shorthand) msg := fmt.Sprintf("%q shorthand is more than one ASCII character", flag.Shorthand)
panic("shorthand is more than one character") fmt.Fprintf(f.out(), msg)
panic(msg)
} }
if f.shorthands == nil { if f.shorthands == nil {
f.shorthands = make(map[byte]*Flag) f.shorthands = make(map[byte]*Flag)
} }
c := flag.Shorthand[0] c := flag.Shorthand[0]
old, alreadythere := f.shorthands[c] used, alreadyThere := f.shorthands[c]
if alreadythere { if alreadyThere {
fmt.Fprintf(f.out(), "%s shorthand reused: %q for %s already used for %s\n", f.name, c, flag.Name, old.Name) msg := fmt.Sprintf("unable to redefine %q shorthand in %q flagset: it's already used for %q flag", c, f.name, used.Name)
panic("shorthand redefinition") fmt.Fprintf(f.out(), msg)
panic(msg)
} }
f.shorthands[c] = flag f.shorthands[c] = flag
} }
// AddFlagSet adds one FlagSet to another. If a flag is already present in f // AddFlagSet adds one FlagSet to another. If a flag is already present in f
// the flag from newSet will be ignored // the flag from newSet will be ignored.
func (f *FlagSet) AddFlagSet(newSet *FlagSet) { func (f *FlagSet) AddFlagSet(newSet *FlagSet) {
if newSet == nil { if newSet == nil {
return return
@ -781,8 +877,10 @@ func VarP(value Value, name, shorthand, usage string) {
// returns the error. // returns the error.
func (f *FlagSet) failf(format string, a ...interface{}) error { func (f *FlagSet) failf(format string, a ...interface{}) error {
err := fmt.Errorf(format, a...) err := fmt.Errorf(format, a...)
fmt.Fprintln(f.out(), err) if f.errorHandling != ContinueOnError {
f.usage() fmt.Fprintln(f.out(), err)
f.usage()
}
return err return err
} }
@ -798,34 +896,6 @@ func (f *FlagSet) usage() {
} }
} }
func (f *FlagSet) setFlag(flag *Flag, value string, origArg string) error {
if err := flag.Value.Set(value); err != nil {
return f.failf("invalid argument %q for %s: %v", value, origArg, err)
}
// mark as visited for Visit()
if f.actual == nil {
f.actual = make(map[NormalizedName]*Flag)
}
f.actual[f.normalizeFlagName(flag.Name)] = flag
flag.Changed = true
if len(flag.Deprecated) > 0 {
fmt.Fprintf(os.Stderr, "Flag --%s has been deprecated, %s\n", flag.Name, flag.Deprecated)
}
if len(flag.ShorthandDeprecated) > 0 && containsShorthand(origArg, flag.Shorthand) {
fmt.Fprintf(os.Stderr, "Flag shorthand -%s has been deprecated, %s\n", flag.Shorthand, flag.ShorthandDeprecated)
}
return nil
}
func containsShorthand(arg, shorthand string) bool {
// filter out flags --<flag_name>
if strings.HasPrefix(arg, "-") {
return false
}
arg = strings.SplitN(arg, "=", 2)[0]
return strings.Contains(arg, shorthand)
}
func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) { func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []string, err error) {
a = args a = args
name := s[2:] name := s[2:]
@ -833,10 +903,11 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
err = f.failf("bad flag syntax: %s", s) err = f.failf("bad flag syntax: %s", s)
return return
} }
split := strings.SplitN(name, "=", 2) split := strings.SplitN(name, "=", 2)
name = split[0] name = split[0]
flag, alreadythere := f.formal[f.normalizeFlagName(name)] flag, exists := f.formal[f.normalizeFlagName(name)]
if !alreadythere { if !exists {
if name == "help" { // special case for nice help message. if name == "help" { // special case for nice help message.
f.usage() f.usage()
return a, ErrHelp return a, ErrHelp
@ -844,11 +915,12 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
err = f.failf("unknown flag: --%s", name) err = f.failf("unknown flag: --%s", name)
return return
} }
var value string var value string
if len(split) == 2 { if len(split) == 2 {
// '--flag=arg' // '--flag=arg'
value = split[1] value = split[1]
} else if len(flag.NoOptDefVal) > 0 { } else if flag.NoOptDefVal != "" {
// '--flag' (arg was optional) // '--flag' (arg was optional)
value = flag.NoOptDefVal value = flag.NoOptDefVal
} else if len(a) > 0 { } else if len(a) > 0 {
@ -860,7 +932,11 @@ func (f *FlagSet) parseLongArg(s string, args []string, fn parseFunc) (a []strin
err = f.failf("flag needs an argument: %s", s) err = f.failf("flag needs an argument: %s", s)
return return
} }
err = fn(flag, value, s)
err = fn(flag, value)
if err != nil {
f.failf(err.Error())
}
return return
} }
@ -868,38 +944,52 @@ func (f *FlagSet) parseSingleShortArg(shorthands string, args []string, fn parse
if strings.HasPrefix(shorthands, "test.") { if strings.HasPrefix(shorthands, "test.") {
return return
} }
outArgs = args outArgs = args
outShorts = shorthands[1:] outShorts = shorthands[1:]
c := shorthands[0] c := shorthands[0]
flag, alreadythere := f.shorthands[c] flag, exists := f.shorthands[c]
if !alreadythere { if !exists {
if c == 'h' { // special case for nice help message. if c == 'h' { // special case for nice help message.
f.usage() f.usage()
err = ErrHelp err = ErrHelp
return return
} }
//TODO continue on error
err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands) err = f.failf("unknown shorthand flag: %q in -%s", c, shorthands)
return return
} }
var value string var value string
if len(shorthands) > 2 && shorthands[1] == '=' { if len(shorthands) > 2 && shorthands[1] == '=' {
// '-f=arg'
value = shorthands[2:] value = shorthands[2:]
outShorts = "" outShorts = ""
} else if len(flag.NoOptDefVal) > 0 { } else if flag.NoOptDefVal != "" {
// '-f' (arg was optional)
value = flag.NoOptDefVal value = flag.NoOptDefVal
} else if len(shorthands) > 1 { } else if len(shorthands) > 1 {
// '-farg'
value = shorthands[1:] value = shorthands[1:]
outShorts = "" outShorts = ""
} else if len(args) > 0 { } else if len(args) > 0 {
// '-f arg'
value = args[0] value = args[0]
outArgs = args[1:] outArgs = args[1:]
} else { } else {
// '-f' (arg was required)
err = f.failf("flag needs an argument: %q in -%s", c, shorthands) err = f.failf("flag needs an argument: %q in -%s", c, shorthands)
return return
} }
err = fn(flag, value, shorthands)
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 return
} }
@ -907,6 +997,7 @@ func (f *FlagSet) parseShortArg(s string, args []string, fn parseFunc) (a []stri
a = args a = args
shorthands := s[1:] shorthands := s[1:]
// "shorthands" can be a series of shorthand letters of flags (e.g. "-vvv").
for len(shorthands) > 0 { for len(shorthands) > 0 {
shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn) shorthands, a, err = f.parseSingleShortArg(shorthands, args, fn)
if err != nil { if err != nil {
@ -954,18 +1045,24 @@ func (f *FlagSet) parseArgs(args []string, fn parseFunc) (err error) {
// The return value will be ErrHelp if -help was set but not defined. // The return value will be ErrHelp if -help was set but not defined.
func (f *FlagSet) Parse(arguments []string) error { func (f *FlagSet) Parse(arguments []string) error {
f.parsed = true f.parsed = true
f.args = make([]string, 0, len(arguments))
assign := func(flag *Flag, value, origArg string) error { if len(arguments) < 0 {
return f.setFlag(flag, value, origArg) return nil
} }
err := f.parseArgs(arguments, assign) 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 { if err != nil {
switch f.errorHandling { switch f.errorHandling {
case ContinueOnError: case ContinueOnError:
return err return err
case ExitOnError: case ExitOnError:
fmt.Println(err)
os.Exit(2) os.Exit(2)
case PanicOnError: case PanicOnError:
panic(err) panic(err)
@ -974,7 +1071,7 @@ func (f *FlagSet) Parse(arguments []string) error {
return nil return nil
} }
type parseFunc func(flag *Flag, value, origArg string) error type parseFunc func(flag *Flag, value string) error
// ParseAll parses flag definitions from the argument list, which should not // 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 // include the command name. The arguments for fn are flag and value. Must be
@ -985,11 +1082,7 @@ func (f *FlagSet) ParseAll(arguments []string, fn func(flag *Flag, value string)
f.parsed = true f.parsed = true
f.args = make([]string, 0, len(arguments)) f.args = make([]string, 0, len(arguments))
assign := func(flag *Flag, value, origArg string) error { err := f.parseArgs(arguments, fn)
return fn(flag, value)
}
err := f.parseArgs(arguments, assign)
if err != nil { if err != nil {
switch f.errorHandling { switch f.errorHandling {
case ContinueOnError: case ContinueOnError:
@ -1036,14 +1129,15 @@ func Parsed() bool {
// CommandLine is the default set of command-line flags, parsed from os.Args. // CommandLine is the default set of command-line flags, parsed from os.Args.
var CommandLine = NewFlagSet(os.Args[0], ExitOnError) var CommandLine = NewFlagSet(os.Args[0], ExitOnError)
// NewFlagSet returns a new, empty flag set with the specified name and // NewFlagSet returns a new, empty flag set with the specified name,
// error handling property. // error handling property and SortFlags set to true.
func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet { func NewFlagSet(name string, errorHandling ErrorHandling) *FlagSet {
f := &FlagSet{ f := &FlagSet{
name: name, name: name,
errorHandling: errorHandling, errorHandling: errorHandling,
argsLenAtDash: -1, argsLenAtDash: -1,
interspersed: true, interspersed: true,
SortFlags: true,
} }
return f return f
} }

88
vendor/github.com/spf13/pflag/int16.go generated vendored Normal file
View File

@ -0,0 +1,88 @@
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)
}