I'm writing an autocomplete script for supervisorctl
.
Is it possible to complete a numeric parameter such as -6
, -999
etc?
Currently my call to _arguments
looks like, which doesn't work:
_arguments \
'--[last N bytes of process stdout]:number'
The first dash is the pattern to match, and the second dash indicates the argument must be in the same word.. But obv this clashes with a normal double dash argument.
EDIT: perhaps this will better explain what I want to do. The following illustrates what I want to happen at the cli:
> supervisorctl tail -<TAB>
-- option --
- -- last N bytes of process stdout
-f -- Continuous tail of named process stdout
This above is what currently happens in my script. I select the first item in the option list, and get this:
> supervisorctl tail - <CURSOR>
I believe a trailing -
will leave the cursor adjacent to the dash. How can I encode that in the parameter definition?
A work-in-progress for this can be found at:
https://github.com/mafrosis/zsh-completions/blob/supervisorctl/src/_supervisorctl