stefan-hoeck / idris2-pack

BSD 3-Clause "New" or "Revised" License
105 stars 27 forks source link

[ completion ] Shell completion suggests options after commands, which is not supported #300

Open buzden opened 3 months ago

buzden commented 3 months ago

Currently the design decision is that all options must go before the command name. But since shell completion script uses only the current and the previous words, it cannot tell if the command is already entered or not. That's why it suggests all options after, say, pack build pack.ipkg --<cursor here> .

I'm not an expert on how shell completion works, and I don't know if we can get more previous strings before the current one, but if we can, we definitely should change the algorithm of completion to take this into account.