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

Re: [PATCH] ulimit option completions using ulimit -a output



2020-11-26 20:14:31 +0000, Stephane Chazelas:
[...]
> The problem is that the list of ulimit options is system
> dependent, so I propose the improvement below which uses the
> output of ulimit -a to build the list of completions.
[...]
> +++ b/Completion/Zsh/Command/_ulimit
[...]
>    '-S[set soft and hard limits (with -H)]' \
[...]
> +  '-N+[specify limit by number]:limit number' \
[...]
> +  '*:file size (blocks)'
[...]

Sorry, should have been

'-N+[specify limit by number]:limit number::limit value'

Otherwise you'd get "Completing file size (blocks)" when
pressing Tab after "ulimit -N 15 ".

Now I need to figure out how to amend a commit that is not the
latest...

By the way, should I cache that list of options retrieved from
the output of "ulimit -a"? After all, it's not going to change
from one run to the next. But then again, a $(ulimit -a) command
substitution is going to be fast and caching uses up memory. Do
you have recommendations as to when to cache and when not to?

-- 
Stephane




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