Zsh not installing correctly? #6190
Replies: 4 comments 1 reply
-
|
I don't know why but it is located in /help only not /functions. |
Beta Was this translation helpful? Give feedback.
-
|
From what I gathered:
@daeho-ro is this consistent with what you see on your end / expect? |
Beta Was this translation helpful? Give feedback.
-
|
As far as I know This is the working version of your test. short_test_zpo() {
zmodload zsh/zutil # Use this for macOS instead of autoload if needed
local -A opts
local -a args
args=("${(@)argv}") # Copy the original arguments
zparseopts -E -A opts -- f -f
# Remove all recognized options from args
for opt in "${(@k)opts}"; do
args=(${args:#$opt})
done
if [[ -n ${opts[(i)-f]} || -n ${opts[(i)--f]} ]]; then
echo "✅ Option -f/--f was passed"
else
echo "❌ Option -f/--f was NOT passed"
fi
echo " Remaining args: ${args[*]}"
}And this is the simple test ❯ short_test_zpo -f test 1
✅ Option -f/--f was passed
Remaining args: test 1
❯ short_test_zpo --f test 1
✅ Option -f/--f was passed
Remaining args: test 1
❯ short_test_zpo -d test 2
❌ Option -f/--f was NOT passed
Remaining args: -d test 2This works for me even without EDIT: I had a typo, this is the correct version of zparseopts: Each option should be with one "-" less than it actually have when used. So, it should be "-f" for "--f". I also added this test result. |
Beta Was this translation helpful? Give feedback.
-
|
Thanks @viking1304 Hmm, Your answer works: However, I try to define multi-letter arguments instead, it doesn't seem to work |
Beta Was this translation helpful? Give feedback.
Uh oh!
There was an error while loading. Please reload this page.
Uh oh!
There was an error while loading. Please reload this page.
-
Output of
brew configOutput of
brew doctorDescription of issue
I'm having issues with
zparseoptsand it looks like Brew didn't install it correctly, see this simple test below (all similar tests fail):Relevant casks
Zsh
Beta Was this translation helpful? Give feedback.
All reactions