add --all-namespaces flag to request across all namespaces

This commit is contained in:
Masahiro Sano
2015-05-12 20:14:31 +09:00
parent d9d12fd3f7
commit 8ce64ec69e
11 changed files with 50 additions and 30 deletions

View File

@@ -177,16 +177,18 @@ type handlerEntry struct {
// will only be printed if the object type changes. This makes it useful for printing items
// recieved from watches.
type HumanReadablePrinter struct {
handlerMap map[reflect.Type]*handlerEntry
noHeaders bool
lastType reflect.Type
handlerMap map[reflect.Type]*handlerEntry
noHeaders bool
withNamespace bool
lastType reflect.Type
}
// NewHumanReadablePrinter creates a HumanReadablePrinter.
func NewHumanReadablePrinter(noHeaders bool) *HumanReadablePrinter {
func NewHumanReadablePrinter(noHeaders, withNamespace bool) *HumanReadablePrinter {
printer := &HumanReadablePrinter{
handlerMap: make(map[reflect.Type]*handlerEntry),
noHeaders: noHeaders,
handlerMap: make(map[reflect.Type]*handlerEntry),
noHeaders: noHeaders,
withNamespace: withNamespace,
}
printer.addDefaultHandlers()
return printer