cmdspec

package
v0.12.0 Latest Latest
Warning

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

Go to latest
Published: Jun 12, 2026 License: MIT Imports: 2 Imported by: 0

Documentation

Overview

Package cmdspec parses the unified command grammar shared by the TUI command bar and config aliases: a backend prefix ("git ...", "jj ...") routes to that backend, a shell prefix ("!...", "sh ...", "shell ...") to the system shell, and anything else to per-repo VCS subcommand routing (each repo's own backend decides how to run it).

Index

Constants

View Source
const PrefixShell = "sh"

PrefixShell is the prefix returned for shell commands.

Variables

This section is empty.

Functions

func ExpandAlias

func ExpandAlias(aliases map[string]string, input string) string

ExpandAlias replaces a leading alias token in input with its expansion, keeping the rest of the input as trailing text. Returns input unchanged when the first token is not a known alias.

func Parse

func Parse(input string) (string, string)

Parse splits input into a routing prefix and the command remainder. The prefix is PrefixShell, a registered backend name, or "" for per-repo VCS subcommand routing.

Types

This section is empty.

Jump to

Keyboard shortcuts

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