Skip to content

MADR CLI interface: Febuary 3, 2026

Authors
Joe Starr, Ph.D. image

Joe Starr, Ph.D.

I specialize in computational knot theory. I’m also a professional embedded software engineer.

Context and Problem Statement

The CLI needs a collection of command line arguments to be useful. We need to decide on what the shape of those arguments/options should be.

Decision Drivers

  • Simplicity, the interface should favor simplicity over features.
  • The interface has to be fast and flexible.
  • The interface has to be obvious.

Decision Outcome

Multiple sets of options satisfy our needs. We will choose the following:

  1. -c: Number of words to generate, default 10
  2. -s: A stack size to allocate, default 100
  3. input on standard in
  4. output on standard out

Considered Options

  1. -c: Number of words to generate, default 10
  2. -l: A path to a file
  3. -o: A path to an output file
  4. -s: A stack size to allocate, default 100
  5. input on standard in
  6. output on standard out

Pros and Cons of the Options

-c

  • Good, simple control of repetitions
  • Good, "matches" DGL v1

-l

  • Good, portable
  • Good, doesn't need special termination
  • Good, user friendly
  • Bad, path manipulation can be annoying
  • Bad, redundant with cat <> | pdgl

-o

  • Good, portable
  • Good, user friendly
  • Bad, redundant with >

-s

  • Good, simple control of repetitions
  • Good, allows for system/run specific experimentation

stdin

  • Good, simple
  • Good, portable
  • Bad, requires a special EOF terminal char

stdout

  • Good, simple
  • Good, portable
  • Good, no special memory management
  • Bad, path handling can be challenging

More Information

N/A