commands

package
v0.42.0 Latest Latest
Warning

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

Go to latest
Published: Sep 22, 2026 License: Apache-2.0 Imports: 90 Imported by: 0

Documentation

Index

Constants

This section is empty.

Variables

View Source
var (
	//ErrUnknownProjectName signals an unknown project was requested/referred
	ErrUnknownProjectName = errors.New("unknown project name")
)

Functions

func DatatugCommand

func DatatugCommand() *cobra.Command

DatatugCommand builds the `datatug` root command tree.

A bare `datatug` invocation (and any invocation whose first positional argument does not match a registered subcommand) falls through to `ui` — this replicates urfave/cli/v3's DefaultCommand: "ui" behaviour, which took priority over the root's own Action in every case, including when --tui was set (the root Action's TUIFlag.IsSet() check was consequently dead code: DefaultCommand always intercepted execution first). Only the --tui/-t flag surface is preserved here; the root RunE ignores it, exactly as the unreachable original Action's callers never observed it either.

func Exit added in v0.12.0

func Exit(message string, code int) error

Exit returns an error that carries a specific process exit code. Returning it from a command's RunE propagates up to main, which exits with code — the same contract github.com/urfave/cli/v3's cli.Exit provided.

func InstallCommand added in v0.31.0

func InstallCommand() *cobra.Command

InstallCommand returns the "install" command, built from github.com/strongo/cli-helpers/cliinstall/cobracmd against datatug's own catalog id (cli-install#req:host-identity-from-catalog). `install` lists the fleet CLIs relevant to datatug (`ingitdb`, `ovdb`, `specscore`) with their live status, and `install <name>...` installs them the same way datatug itself was installed. cobracmd.New panics if "datatug" is absent from the compiled catalog — a programming error this package's own tests catch (TestInstallCommand_Shape proves the real entry resolves), never a runtime state a user sees.

func RegisterAsViewer added in v0.1.0

func RegisterAsViewer()

func SelfUpdateCommand added in v0.31.0

func SelfUpdateCommand(ver string) *cobra.Command

SelfUpdateCommand returns the "self-update" command, built from github.com/strongo/cli-helpers/selfupdate/cobracmd against datatugSelfUpdateConfig's identity.

func UpgradeCommand added in v0.31.0

func UpgradeCommand(ver string) *cobra.Command

UpgradeCommand returns the "upgrade" command, built from github.com/strongo/cli-helpers/cliinstall/cobracmd against datatug's own catalog id. HostConfig comes from the exact same datatugSelfUpdateConfig helper SelfUpdateCommand uses, and datatug's self-update has no after-update hook to pass as HostAfterUpdate, so `datatug self-update` and `datatug upgrade datatug` reach the exact same library call (cli-install#req:self-update-equals-upgrade-self). ver is the running build's own version, matching SelfUpdateCommand's own parameter.

Types

type Encoder

type Encoder interface {
	Encode(v interface{}) error
}

Encoder defines interface to encode

type ExitCoder added in v0.12.0

type ExitCoder interface {
	error
	ExitCode() int
}

ExitCoder is implemented by an error that must terminate the process with a specific exit code. It is this package's replacement for github.com/urfave/cli/v3's ExitCoder contract, which several mutating commands (db copy, entity authoring, --git mode validation) relied on before the migration to cobra. main() checks for this interface after the root command returns and exits with ExitCode() when present.

type Options

type Options struct {
}

Options defines common options for commands

Jump to

Keyboard shortcuts

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