I would like to have 2 different behavior of "tab" depending of the usage context.
I would like to have the default behavior of bind '"\t":complete'
any time except when users are trying to complete arguments of the "mybashfunction" command. In this case I call a special function to generate the completion, but I would like "tab" to work like if bind '"\t":menu-complete'
was set.
I believe that its readline library will only support one kind of tab-completion behaviour at a time.
Is this what you're looking for? Bash: menu-complete only for few matches
You can achieve this by using bash complete rules ...
This won't touch bash's normal completion but when you tab complete myfunc you'll have "zero one two" as possible completions.
Edit: oh yeah, jam this into your bashrc or similar so it's sourced in new shells.