refactor: git ignore all tools/agents startsWith _ (#130)

This commit is contained in:
sigoden
2024-11-29 18:16:36 +08:00
committed by GitHub
parent ecf7233401
commit 139bd5a3f6
4 changed files with 21 additions and 11 deletions
+9 -2
View File
@@ -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
]'
}