clop

Command-Line OPtions

What clop reads

clop obtains help text two ways, and detects a version one way:

SourceHow
Run program --helpwhen you name a PROGRAM
Read help text from a fileclop -f FILE
Read help text from standard inputclop - (e.g. prog --help \| clop -)
Detect the version via program --versionautomatically, when you name a PROGRAM

That is the whole list. If a program prints one option per line, the layout used by GNU coreutils, BusyBox, and Toybox, then clop counts it well.

What it does not handle (yet)

clop is deliberately small, so several common "give me help" conventions are left out. In each case, capture the text yourself and feed it in with -f or -:

In short, clop reliably handles --help, -f FILE, and stdin for one-option-per-line layouts. Anything else, such as -h, man, info, subcommand trees, or unusual formatting, you can almost always feed in manually.

Security

Naming a program makes clop run program --help (and program --version), exactly as if you had typed them yourself. Only pass names of programs you trust. To analyze help text without running anything, capture it first:

untrusted --help > help.txt
clop -f help.txt

The script never passes your input to a shell, never uses eval, and treats help text strictly as text (shell glob characters are not expanded).