2

I have 2 commands that I switch between using update-alternatives on Debian. My problem is that each command also has an autocompleter command that has to be switched at the same time the command is switched. Is there some way I can keep the 2 commands managed in a single "alternative", so that when I switch commands (using update-alternatives --set ...) the autocompleter is switched as well?

1 Answer 1

4

Make the autocompleter a slave link. See the manual for details (look for "changed as a group").

In your package's postinst script:

update-alternatives --install /usr/bin/someprogram someprogram /usr/bin/foo-someprogram $PRIORITY \
    --slave /usr/share/zsh/site-functions/_someprogram /usr/share/zsh/site-functions/_foo-someprogram

where $PRIORITY is the numeric priority of the alternative when automatic selection takes place.

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.