phronmophobic / membrane.term

A terminal emulator in pure clojure
Eclipse Public License 1.0
53 stars 1 forks source link

Rethink command line short opts for future extensibility #16

Closed lread closed 2 years ago

lread commented 2 years ago

Extracted from #15:

Problem

Our current stab at the command line includes both shortopts and longopts for each command-line option.

As we add more options, we have found that finding meaningful non-conflicting shortopt can be a challenge.

Analysis

For inspiration we looked at:

Choice

We've chosen to continue with the unix-style conventional syntax and only include shortops for what we feel will be commonly used options. Our guess may be wrong, but it is likely good enough.

Result

This WIP:

Common Options:
  -w, --width=<cols>         Width in characters [default: 90]
  -h, --height=<rows>        Height in characters [default: 30]
  -c, --color-scheme=<path>  Local path or url to iTerm .itermcolors scheme file, uses internal scheme by default.
  -f, --font-family=<font>   Choose an OS installed font [default: monospace]
  -s, --font-size=<points>   Specify the font point size [default: 12]

Screenshot Options:
  -p, --play=<path>          Path to script to play in terminal
  -o, --out=<file>           Filename of the image to generate [default: terminal.png]
  -l, --line-delay=<ms>      Delay in ms to wait after each line is sent to the terminal [default: 1000]
  -d, --final-delay=<ms>     Delay in ms to wait before writing the view of the terminal [default: 10000]

Could become:

Common Options:
  -w, --width=<cols>         Width in characters [default: 90]
  -h, --height=<rows>        Height in characters [default: 30]
      --color-scheme=<path>  Local path or url to iTerm .itermcolors scheme file, uses internal scheme by default.
      --font-family=<font>   Choose an OS installed font [default: monospace]
      --font-size=<points>   Specify the font point size [default: 12]

Screenshot Options:
  -p, --play=<path>          Path to script to play in terminal
  -o, --out=<file>           Filename of the image to generate [default: terminal.png]
      --line-delay=<ms>      Delay in ms to wait after each line is sent to the terminal [default: 1000]
      --final-delay=<ms>     Delay in ms to wait before writing the view of the terminal [default: 10000]

Next steps

I'll follow up with a PR.