Merge pull request #1806 from NoahGorny/cleanup/conda-completions

formatted conda completion and used helper function
pull/1805/head
Noah Gorny 2021-01-28 16:34:51 +02:00 committed by GitHub
commit 284819e718
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
2 changed files with 12 additions and 4 deletions

View File

@ -60,6 +60,7 @@ plugins/available/xterm.plugin.bash
completion/available/awless.completion.bash
completion/available/brew.completion.bash
completion/available/cargo.completion.bash
completion/available/conda.completion.bash
completion/available/knife.completion.bash
completion/available/packer.completion.bash
completion/available/pipx.completion.bash

View File

@ -1,4 +1,11 @@
#!/usr/bin/env bash
which register-python-argcomplete > /dev/null \
&& eval "$(register-python-argcomplete conda)" \
|| echo "Please install argcomplete to use conda completion"
# shellcheck shell=bash
cite "about-completion"
about-completion "conda completion"
if _command_exists conda; then
if _command_exists register-python-argcomplete; then
eval "$(register-python-argcomplete conda)"
else
_log_warning "Argcomplete not found. Please run 'conda install argcomplete'"
fi
fi