0

I was wondering if it's possible to make compgen (complete) only display possible options without completing.

for example with COMPREPLY=( $( compgen -W "--option1 --option2" -- $cur )) --option1 --option2 will be suggested but -- will be added to my command line. Can I get rid of --

I took a look at compgen's options but I cannot find the one that can help. I don't want to do any hack ( for eg displaying options first and then COMPREPLY=( $( compgen -W "" -- $cur )))

Tor Tor
  • 35
  • 6
  • `compgen` *does* only display the completions. Putting them into `COMPREPLY` is what completes. – Benjamin W. Jun 13 '19 at 14:29
  • Thanks for your response, but running `compgen -W "--option1 --option2" -- $cur` the shell turns into a mess, how can I get the options above my command line as usual ? – Tor Tor Jun 13 '19 at 14:36
  • After `cli + Tab Tab` I want the options `--option1 --option2` to be displayed but I don't want `--` to be added to my command line (`cli`). `compgen` has an option `-P` to add a prefix to displayed options, I'll test it. – Tor Tor Jun 13 '19 at 16:02
  • Have you get this working? I have exactly same problem – Liso Dec 30 '21 at 10:57

0 Answers0