Commands
emit arguments as a line
emit literal text
generate a numeric sequence
repeat a line until interrupted
list directory entries (source)
walk a directory tree (source)
strip directory and suffix
strip the last path component
translate characters
apply an s/// substitution
select fields
concatenate, with optional numbering
output the first lines
output the last lines
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.