Skip to content

Commit

Permalink
fish_completion: use sort -r instead of tac
Browse files Browse the repository at this point in the history
hopefully this is more portable

Fixes #1485
  • Loading branch information
jdx committed Jan 19, 2024
1 parent 73b9b72 commit db646f4
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
3 changes: 2 additions & 1 deletion completions/mise.fish
Original file line number Diff line number Diff line change
Expand Up @@ -384,7 +384,8 @@ function __mise_plugins
end
function __mise_tool_versions
if test -z "$__mise_tool_versions_cache"
set -g __mise_tool_versions_cache (mise plugins --core --user) (mise ls-remote --all | tac)
# sed madness reverses the input-but works on linux/bsd
set -g __mise_tool_versions_cache (mise plugins --core --user) (mise ls-remote --all | sed '1!G;h;$!d')
end
for tv in $__mise_tool_versions_cache
echo $tv
Expand Down
3 changes: 2 additions & 1 deletion src/shell/completions/fish_complete.rs
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,8 @@ function __mise_plugins
end
function __mise_tool_versions
if test -z "$__mise_tool_versions_cache"
set -g __mise_tool_versions_cache (mise plugins --core --user) (mise ls-remote --all | tac)
# sed madness reverses the input-but works on linux/bsd
set -g __mise_tool_versions_cache (mise plugins --core --user) (mise ls-remote --all | sed '1!G;h;$!d')
end
for tv in $__mise_tool_versions_cache
echo $tv
Expand Down

0 comments on commit db646f4

Please sign in to comment.