classorg.draftcode.argot
CommandSpec
Describes a command: its name, description, optional version, and parameters.
Constructors
CommandSpec
- programName
the program name shown in usage.
- description
a one-line description shown at the top of
--help.- params
the declared parameters, in the order they should appear in
--help.- version
when set,
--versionis recognized and prints this string.
Properties
Functions
renderHelp
fun renderHelp(): String
Renders the full --help text: description, usage line, then aligned options and arguments.
renderUsage
fun renderUsage(): String
Renders the single-line usage string, for example Usage: serve [options] <files>....
validate
fun validate(): Unit
Checks this specification for problems such as duplicate names, blank names, or a misplaced multiple positional.
Throws
CommandSpec.kt IllegalArgumentExceptionif the specification is malformed.