View Source Shell.FromOptimus (fnord v0.6.5)
Converts an Optimus spec into the Shell.Completion
DSL format.
The Optimus spec is assumed to be a keyword list with keys such as:
- :name (required)
- :about or :description (for the description)
- :options and :flags (each a keyword list)
- :subcommands (a keyword list where each value is a subcommand spec)
- Optionally :arguments
The conversion ignores keys like :version, :help, :required, :default, etc.
It uses the long flag (if available) as the canonical option name.
For flags, it sets takes_argument: false
.