The bash completion mechanism can also be used from other programs. We could use it to have advanced completions for command arguments.