diff options
| author | sigoden <sigoden@gmail.com> | 2024-11-29 18:16:36 +0800 |
|---|---|---|
| committer | GitHub <noreply@github.com> | 2024-11-29 18:16:36 +0800 |
| commit | 139bd5a3f6738b1d478ffcca497ba09262f443b2 (patch) | |
| tree | 0b86bd8b40fc10f359f5e5cf482b028a41740c99 /scripts/build-declarations.sh | |
| parent | ecf7233401ebe273fa292b8208651395d99ddff9 (diff) | |
| download | llm-functions-docker-139bd5a3f6738b1d478ffcca497ba09262f443b2.tar.gz | |
refactor: git ignore all tools/agents startsWith `_` (#130)
Diffstat (limited to 'scripts/build-declarations.sh')
| -rwxr-xr-x | scripts/build-declarations.sh | 11 |
1 files changed, 9 insertions, 2 deletions
diff --git a/scripts/build-declarations.sh b/scripts/build-declarations.sh index af23590..44b68f4 100755 --- a/scripts/build-declarations.sh +++ b/scripts/build-declarations.sh @@ -17,7 +17,14 @@ main() { } build_declarations() { - jq -r ' + jq --arg is_tool "$is_tool" -r ' + def filter_declaration: + (if $is_tool == "true" then + . + else + select(.name | startswith("_") | not) + end) | select(.description != ""); + def parse_description(flag_option): if flag_option.describe == "" then {} @@ -59,7 +66,7 @@ build_declarations() { parameters: parse_parameter([.flag_options[] | select(.id != "help" and .id != "version")]) }; [ - .[] | parse_declaration | select(.name | startswith("_") | not) | select(.description != "") + .[] | parse_declaration | filter_declaration ]' } |
