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:
ls seems to have shortopts for almost every letter of the alphabet in uppercase and lowercase! I think they got to a point where they just picked a letter. Doesn't seem to use longopts at all.
bash has some longopts without shortops. For less frequently used opts this might make sense.
ripgrep a more modern tool, has many longopts without equivalent shortops.
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]
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:
ls
seems to have shortopts for almost every letter of the alphabet in uppercase and lowercase! I think they got to a point where they just picked a letter. Doesn't seem to use longopts at all.bash
has some longopts without shortops. For less frequently used opts this might make sense.ripgrep
a more modern tool, has many longopts without equivalent shortops.api-diff
uses keywords for options.-X
styleChoice
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:
Could become:
Next steps
I'll follow up with a PR.