Configure options using a Spec
mainOptions in Babashka CLI are configured using a spec (options specification). A spec is a map where keys are option names and values are maps defining the option's behavior.
Key configuration options include:
:coerce: Defines how to transform the string input into a specific type (e.g.,:long,:keyword,:boolean, or a custom function).:alias: Provides a short-form name (e.g.,:pfor--port).:desc: A description used for generating help text.:require: Iftrue, the option must be present.:default: The value used if the option is omitted.:negatable: Iftrue, allows--no-prefix for boolean flags.:validate: A function to validate the coerced value.
You can use a full spec shape or a terser shape (lifting keys to the top level), but only the full spec shape supports :desc and :ref for help generation.
{:spec {:port {:coerce :long :alias :p}}}