refactor: minor refinement

This commit is contained in:
sigoden
2024-05-16 07:13:07 +00:00
parent d346fe5874
commit 4d0a823257
3 changed files with 49 additions and 29 deletions
+12
View File
@@ -71,6 +71,18 @@ main() {
eval "$(argc --argc-eval "$0" "$@")"
```
The relationship between flags/options and parameters in function declarations is as follows:
```sh
# @flag --boolean Parameter `{"type": "boolean"}`
# @option --string Parameter `{"type": "string"}`
# @option --string-enum[foo|bar] Parameter `{"type": "string", "enum": ["foo", "bar"]}`
# @option --integer <INT> Parameter `{"type": "integer"}`
# @option --number <NUM> Parameter `{"type": "number"}`
# @option --array* <VALUE> Parameter `{"type": "array", "items": {"type":"string"}}`
# @option --scalar-required! Use `!` to mark a scalar parameter as required.
# @option --array-required+ Use `+` to mark a array parameter as required
```
**After creating your function, don't forget to rebuild the function declarations.**