Patterns: Command-Line Interface Design Patterns

[Raym03]

Hint

Commands may have modes that fit more than one interface pattern.

Filter pattern

stdin –> transform-data –> stdout

Cantrip pattern

do-something

Note

No input or output.

Source pattern

generate-data –> stdout

Note

No input.

Sink pattern

stdin –> process-data

Note

No output.

Compiler pattern

resource-name/file –> process-contents –> transformed-resource-name/file

Note

Any of the patterns listed above can to write to stderr.

There are other patterns, but they are designed for highly interactive environments and outside the scope of this publication.