cli

package
v0.1.53 Latest Latest
Warning

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

Go to latest
Published: Aug 26, 2026 License: Apache-2.0 Imports: 45 Imported by: 0

Documentation

Overview

Package cli is the csx command dispatcher (contract C9). It is deliberately extensible: each command lives in its own file and registers itself from init(), so later waves add commands without editing any shared file.

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