1

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?

1 Answer 1

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.

You must log in to answer this question.

Start asking to get answers

Find the answer to your question by asking.

Ask question

Explore related questions

See similar questions with these tags.