I said basic!
#/usr/bin/env bash
_alire_completions()
{
COMPREPLY=($(compgen -W "\
help cache settings config instsall toolchain version \
get index search show \
build clean edit exec init pin printenv run update with \
action dev test \
publish \
" "${COMP_WORDS[1]}"))
}
complete -F _alire_completions alr
~/.bashrc:
source ~/.bash_alire_completionsrc
4 Likes
Lucretia:
instsall
? simple typo, eh? Other than that, AWESOME!
1 Like
mgrojo
December 9, 2025, 10:18pm
4
There’s also a more elaborate autocompletion script in the Alire repository. See:
opened 12:18AM - 28 Apr 24 UTC
There's a much appreciated bash completion script at https://github.com/alire-pr… oject/alire/blob/master/scripts/alr-completion.bash. It would be really nice if the script was bundled with the `alr` executable in such a way that a command would spit out the contents. I think it would be convenient, especially if [features are added later](https://github.com/alire-project/alire/issues/552), for keeping the bash completion script in sync with my alire installation.
As for how to embed the bash script into the executable, C has the [`#embed` preprocessor](https://en.cppreference.com/w/c/preprocessor/embed) since C23. Also, the Ada Web Server project has a tool called [awsres](https://github.com/AdaCore/aws/blob/master/tools/awsres.adb) specifically for generating Ada code to embed resources from file contents.
Not publicised. Good, I’ll use that then.