Zsh Mailing List Archive
Messages sorted by: Reverse Date, Date, Thread, Author

Re: Advanced option parsing across zsh commands



On Jan 26, 10:20am, Sebastian Gniazdowski wrote:
} Subject: Advanced option parsing across zsh commands
}
} I like zparseopts because of -E option, which allows to mix options
} with strings and handles --. Is it expected that one day zsh will do
} the same?

No, this is not expected.

} % set -- a -b something -- -c
} % typeset -A opts
} % zparseopts -A opts -DE b: c
} % echo "${(kv)opts}"
} 
} % # $1, $2, ... $5 are still the same

You can't stack the options of zparseopts itself, i.e, you can't use -DE,
you have to use -D -E.

zparseopts also doesn't handle "negated options" in the +X format, only
those introduced with "-".  There's a fairly convoluted issue with making
"+" work for the associative array case because of the way zparseopts
gathers up the arguments of each option before assigning to the array.



Messages sorted by: Reverse Date, Date, Thread, Author