2
0
Fork 0
mirror of https://github.com/fish-shell/fish-shell synced 2025-01-27 20:25:12 +00:00
fish-shell/share/functions/__fish_complete_blockdevice.fish

13 lines
325 B
Fish
Raw Normal View History

# Helper function for completions that need to enumerate block devices.
function __fish_complete_blockdevice
set -l cmd (commandline -ct)
test "" = "$cmd"
and return
for f in $cmd*
test -b $f
and printf "%s\t%s\n" $f "Block device"
test -d $f
and printf "%s\n" $f/
end
end