I recently ran in trouble with an
command executed in a shell expansion, and in which the string started with a dash (-). Even single quotes around the string did not stop Kakoune from interpreting it as an illegal switch to
exec and raising an error. Fortunately there is a way around, using two dashes
-- to signal switch ending
exec -- "$string"
as in the case of many standard Unix commands. This also works with Kakoune commands that accept switches, such as
I have seen this trick used in a few script examples, but I have not seen it documented anywhere. If I am right about the lack of documentation, then this post with its title may be helpful to Kakoune newcomers.