Poetry Configuration¶
Enabling bash-completion (poetry)¶
The official instructions include the following:
# Bash
poetry completions bash > /etc/bash_completion.d/poetry.bash-completion
This assumes commands can be performed as root, assumptions are bad!
Instead, make [mkdir-options] a ‘local’ etc/bash_completion.d directory and alter the above code to use this:
~/ $ mkdir -p $CONF_DIR/bash_completion.d
~/ $ poetry completions bash > $CONF_DIR/bash_completion.d/poetry.bash-completion
To enable this, it must be sourced:
~/ $ source $CONF_DIR/bash_completion.d/poetry.bash-completion
To automatcially enable all completions, the following may be used:
~/ $ printf "\nsource %s\n" \
"$CONF_DIR/bash_completion.d/*.bash-completion" \
>> $HOME/.bashrc
~/ $ tail -n 2 $HOME/.bashrc
source [...]
[mkdir-options]
command line arguments
- -p, --parents
no error if existing, make parent directories as needed, with their file modes unaffected by any -m option.