class Obsctl::Domain::CommandParser

Overview

Turns command input into typed command objects.

There are two entry points because there are two kinds of caller. The CLI already has its arguments split by the kernel and passes them through untouched; the TUI palette has a single line of text and tokenizes first. Argument values never round-trip through a quoted string, so names containing quotes, tabs, or backslashes survive intact.

Defined in:

obsctl/domain/command_parser.cr

Constant Summary

MAX_TARGET_TOKEN_LENGTH = 256

Instance Method Summary

Instance Method Detail

def parse(argv : Array(String)) : Command #

Parses an already-split argument vector, e.g. ["scene", "Main Camera"].

Shell words arrive with their quoting already resolved, so nothing here is treated as quoted.


[View source]
def parse(input : String) : Command #

Parses one command line, including quoted arguments.


[View source]