struct

Obsctl::Domain::CommandSpec

Inherits Struct < Value < Object

One command, declared once.

This is the single source of truth for the command set. The parser, the --json allowlist, palette completion, --help, and the generated shell completions all read it, so a command cannot exist on one surface and be missing from another.

Constructors

new(name : String, summary : String, build : Proc(Array(String), Command), aliases : Array(String) = [] of String, arguments : Array(ArgumentKind) = [] of ArgumentKind, required_arguments : Int32 = -1, surface : CommandSurface = CommandSurface::Cli | CommandSurface::Palette, json : Bool = false)
Source

Instance methods

aliases
Source
arguments
Source
build
Source
cli?
Source
json?
Source
name
Source
palette?
Source
required_arguments
Source
spellings

Every spelling that resolves to this command.

Source
summary
Source
surface
Source
usage

name <arg> <arg> as shown in help.

Source
validate_arity!(args : Array(String)) : Nil

Validates the supplied argument count against this command's arity.

Source