cli

package
v0.2.15 Latest Latest
Warning

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

Go to latest
Published: Oct 9, 2026 License: Apache-2.0 Imports: 49 Imported by: 0

Documentation

Overview

Package cli is the csx command dispatcher (contract C9). It is deliberately extensible: each shipped command lives in its own file and registers itself from init(), so the command surface can grow without editing a central dispatcher.

Index

Constants

This section is empty.

Variables

View Source
var Version = "dev (git)"

Version is the build stamp, overridable at link time:

go build -ldflags "-X github.com/r2cuerdame/codesamplex/internal/cli.Version=v1.0.0"

Functions

func Main

func Main(argv []string) int

Main dispatches argv to the matching command and returns the process exit code. No arguments or an explicit help request prints usage.

func Register

func Register(cmd Command)

Register adds a command to the dispatcher. Commands call it from init(); duplicate or incomplete registrations are programmer errors.

Types

type Command

type Command struct {
	Name    string
	Summary string
	Run     func(ctx context.Context, args []string) int
}

Command is one csx subcommand.

func Commands

func Commands() []Command

Commands returns every registered command sorted by name.

Jump to

Keyboard shortcuts

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