Created
October 8, 2022 10:45
-
-
Save jonashaag/a66b6d7ac48daed35bbd8f580299cc30 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
function __micromamba_completion | |
set -l args (commandline -ocp) | |
# TODO: micromamba completer should be able to ignore micromamba program name (first arg) | |
set -e args[1] | |
set -l suggestions ($MAMBA_EXE completer $args (commandline -t)) | |
# TODO: micromamba completer should output lines not columnified | |
if echo "$suggestions" | grep -q " " | |
set suggestions (string split " " "$suggestions") | |
end | |
for suggestion in $suggestions | |
# TODO: Remove trailing whitespace from micromamba completer output | |
string trim --right -- "$suggestion" | |
end | |
return 0 | |
# TODO: Support -p with __fish_complete_directories | |
# TODO: Support -f etc with __fish_complete_path | |
end | |
complete --no-files --command micromamba --arguments "(__micromamba_completion)" |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment