commandgen

package
v0.3.0 Latest Latest
Warning

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

Go to latest
Published: Nov 27, 2026 License: MIT Imports: 14 Imported by: 0 modules, 0 packages

The first number is the count of modules that contain a package that imports this one. The module count is a better indicator of popularity than the package count. A module with 100 importing packages is counted only once instead of 100 times, reflecting the fact that the choice to use the package was likely made only once, not 100 times.
A '?' means that the value hasn't been computed yet.

Documentation

Overview

Package commandgen writes the cobra commands of a group of the command layer, gen/cli.go: one command for each method, with its help, its flags and its examples, for the local generator, the endpoint generator and the behavior generator alike. A local group's command runs its method in the CLI with command.Run; an endpoint group's sends a request with the endpoint layer's Run.

Index

Constants

View Source
const ExampleTraceID = "26e448c9dbe1c4a8d216a98c675079c9"

ExampleTraceID is the trace that each example output ends with, and ExampleNow is the time that an age in one is from, so a page is the same on each run. A sample output gives its times relative to ExampleNow.

Variables

View Source
var ExampleNow = time.Date(2026, time.January, 15, 10, 0, 0, 0, time.UTC)

ExampleNow is the time that an age in an example output is from.

Functions

func Commands

func Commands(
	f *jen.File,
	g command.Group,
	pkg string,
)

Commands writes gen/cli.go: one cobra command for each method, with its help, its permission, its examples and a flag for each input field, and the init that registers them under osapi client <group>, or under osapi for a local group.

func Outputs

func Outputs(
	g command.Group,
	m command.Command,
	line string,
) string

Outputs are the outputs of the examples of m: each example that Prints gave one, or, for a method that answers with no body, each example without --json. For each, the command line and what the CLI prints for it, in a fenced ansi block, then what --json prints. line is the command with its group, such as osapi client agent list.

Types

This section is empty.

Directories

Path Synopsis
Command generate writes the files that come from the local groups: for each group, the cobra commands in gen/cli.go, and internal/cli/commands/all/gen, which registers every group's commands.
Command generate writes the files that come from the local groups: for each group, the cobra commands in gen/cli.go, and internal/cli/commands/all/gen, which registers every group's commands.
Package genfile writes generated files for the local, endpoint and behavior generators alike: it removes the files a run made before, writes each file under the repository's root, and groups a Go file's imports as the repository does.
Package genfile writes generated files for the local, endpoint and behavior generators alike: it removes the files a run made before, writes each file under the repository's root, and groups a Go file's imports as the repository does.

Jump to

Keyboard shortcuts

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