fix(completions/*): skip prev of the form -oOPTARG - #862
Conversation
1fcbe44 to
f7785a9
Compare
There was a problem hiding this comment.
Wow, that's just a huge amount of work you've put into this, thanks! And yes, this is what I meant in #852.
I guess the only thing I'd change here would be to use something else than otherflags for the variable name, because it's not "other" as the set of flag names in it will contain also the one being processed (e.g. for -${otherflags}d there should be a d also in ${otherflags}), and it doesn't capture the reason for its existence in the name.
noargopts springs to mind. This would read nicely like -${noargopts}d -- roughly "dash followed by options that do not take an arg, followed by d".
f7785a9 to
ab7c0b4
Compare
|
Thank you! I have switched to I actually initially thought about |
|
Nice! Merged. Very subtle, but the reason I have a slight preference on "opts" instead of "flags" here is that the glob we use for this contains also the prevention to match long options (and I don't know if "long flags" is a thing, at least it sounds odd to me). |
|
Thanks!
I see. That makes sense. |
I'm not sure if this is what was intended, but this is a possible fix to #852 (comment) (which is causing the test failures in #861 and #546). This properly handles the completion of the form
-oOPTARG [TAB], yet this does not handle the completion of the form-oOPTAR[TAB].I also thought about the possibility of modifying
__reassemble_comp_words_by_refso that-oandOPTARGin a single word-oOPTARGwould be generated as separate words inwords, but this can make the processing more complicated. For example, we need to prefix-ofor the completion ofOPTARGif-oandOPTARGoriginally come from a single word, etc.Edit:
pytestcompletion.