Commands

Flags#

Flags are the responsibility of each cmd-* package; the REPL translates the Unix-style flags you type into the typed options those packages expose. For example wc -l becomes wc.WcLines, head -n 10 (or the GNU shorthand head -10) becomes head.HeadLines(10), and grep -v becomes grep.GrepInvert. See each command's own repository for its full flag semantics.

Not wired yet#

Some constructors need non-textual Go values and can't be built from a typed command line today:

Command Blocker
awk Takes a Program interface (Begin/Condition/Action/End) — there's no string-to-Program parser yet
while Takes a func([]byte) ([]byte, error)
capture Takes io.Writer sinks

If cmd-awk ever offers a parser that builds a Program from a script string, awk can be wired the same way as everything else.

Next: Architecture for how a typed line becomes a running pipeline.

Updated