0

All right, I'm aware about how to provide a custom completion function to a command. And I also know this options can be printed out in a shell session by double hit tab after write that command.

I'm now looking for a way to list the completion options of a given command via bash script. I mean some command that do the same behavior of tap tab twice

Is it possible?

artu-hnrq
  • 297

1 Answers1

2

complete -p command gives you the information what would be done. You can do that on your own.

That seems not to work with functions which use compopt (without a command name). Maybe the mode of operation can be faked somehow. Or you could try writing a function for compopt which adds the name.

Hauke Laging
  • 90,279