From 139bd5a3f6738b1d478ffcca497ba09262f443b2 Mon Sep 17 00:00:00 2001 From: sigoden Date: Fri, 29 Nov 2024 18:16:36 +0800 Subject: refactor: git ignore all tools/agents startsWith `_` (#130) --- scripts/build-declarations.sh | 11 +++++++++-- 1 file changed, 9 insertions(+), 2 deletions(-) (limited to 'scripts/build-declarations.sh') 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 ]' } -- cgit v1.2.3