|
236 | 236 | ;; |
237 | 237 |
|
238 | 238 | (def ^{:private true} spec-keys |
239 | | - [:id :short-opt :long-opt :required :desc :default :default-desc :default-fn |
| 239 | + [:id :short-opt :long-opt :required :desc |
| 240 | + :default :default-desc :default-fn |
240 | 241 | :parse-fn :assoc-fn :update-fn :multi :post-validation |
241 | 242 | :validate-fn :validate-msg :missing]) |
242 | 243 |
|
|
608 | 609 | boolean toggle that is set to true when specified on the |
609 | 610 | command line. |
610 | 611 |
|
| 612 | + :missing Indicates that this option is required (not just an argument), |
| 613 | + and provides the string to use as an error message if omitted. |
| 614 | +
|
611 | 615 | :desc A optional short description of this option. |
612 | 616 |
|
613 | 617 | :default The default value of this option. If none is specified, the |
|
707 | 711 | Regardless of :multi, you cannot specify both :assoc-fn |
708 | 712 | and :update-fn for an option. |
709 | 713 |
|
| 714 | + :multi true/false, applies only to options that use :update-fn. |
| 715 | +
|
710 | 716 | :validate A vector of [validate-fn validate-msg ...]. Multiple pairs |
711 | 717 | of validation functions and error messages may be provided. |
712 | 718 |
|
|
720 | 726 | failure. Can be plain strings, or functions to be applied |
721 | 727 | to the (invalid) option argument to produce a string. |
722 | 728 |
|
| 729 | + :post-validation true/false. By default, validation is performed after |
| 730 | + parsing an option, prior to assoc/default/update processing. |
| 731 | + Specifying true here will cause the validation to be |
| 732 | + performed after assoc/default/update processing, instead. |
| 733 | +
|
723 | 734 | parse-opts returns a map with four entries: |
724 | 735 |
|
725 | 736 | {:options The options map, keyed by :id, mapped to the parsed value |
|
0 commit comments