formatted conda completion and used helper function

pull/1782/head
Gurkirat Singh 2021-01-10 19:22:00 +05:30
parent dd09dc5a58
commit 6e9fa193b7
No known key found for this signature in database
GPG Key ID: CFD64E1DCB3DA835
1 changed files with 11 additions and 3 deletions

View File

@ -1,4 +1,12 @@
#!/usr/bin/env bash
which register-python-argcomplete > /dev/null \
&& eval "$(register-python-argcomplete conda)" \
|| echo "Please install argcomplete to use 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'"
return 1
fi
fi