cub

command module
v0.0.0-...-d9e717c Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Nov 13, 2026 License: MIT Imports: 86 Imported by: 0

Documentation

Overview

Shell completion for entity references.

A reference completes in two steps. With no space on the line, the spaces are offered first, each as "space/" with no trailing blank so the shell stays on the word; once the word names a space, the entities in it are offered as "space/slug". The completed form is the qualified one on purpose: a command assembled with the tab key then carries its own space wherever it is pasted or scripted, and keeps working when the default space is no longer consulted. With --space on the line the space is already known, so the bare slugs in it are offered instead.

Completion runs from cobra's hidden __complete command, outside the target command's own pre-run, so no space has been resolved; it reads the --space flag and the context itself. Nothing may reach stdout except through the return value, and a server that does not answer promptly must not hang the shell, so every lookup runs under a short deadline and every failure completes to nothing.

Entity resolution for the CLI: one function per entity type, each a thin adapter over the cubapi resolvers.

The adapters exist because cub still carries its space as a string global that may be a UUID, "*", or empty; they translate that into the typed ResolveOpts the library takes. When the space becomes a resolved value on the command's run context, the adapters lose their spaceID parameter and most of them disappear.

Every lookup accepts the spellings a person writes: a slug, a "space/slug", or a UUID. A UUID is never scoped by space -- see cubapi's resolve.go.

Source Files

Directories

Path Synopsis
Package k8sdescribe renders "kubectl describe"-style summaries of Kubernetes resources stored in ConfigHub.
Package k8sdescribe renders "kubectl describe"-style summaries of Kubernetes resources stored in ConfigHub.

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL
⌂ 换网址