shell-completions
shell-completions copied to clipboard
fix echo bug for mac
Mac wil trow error on /usr/bin/echo
Using the builtin echo breaks this check for me locally. It'd probably be better to just find a better way to do the check.
This patch seems to work for me but it's a bit a bit unreliable depending on how long zig build --help takes.
diff --git a/_zig b/_zig
index 5f8e500..72b2bbb 100644
--- a/_zig
+++ b/_zig
@@ -285,10 +285,10 @@ __zig_build() {
fi
done <<< $help
- if [ -z "$(/usr/bin/echo $words[$CURRENT] | grep "^-")" ]; then
- _describe 'step' steps
- else
+ if [[ $words[$CURRENT] == -* ]]; then
_arguments ${args[@]}
+ else
+ _describe 'step' steps
fi
}
✅ : zig build<tab>

🟥 : zig build<space><tab>

inserts \ \ on tab completion
🟥 : zig build -<tab>
no tab completion
Note this is for both versions, i didn't test the first time