fish-shell/share/functions/__fish_complete_blockdevice.fish
Frederik “Freso” S. Olesen 7af9e1f5c5 Split off __fish_complete_blockdevice from mount.fish.
The __fish_complete_blockdevice function can be useful to other
completions than mount.fish, so it should live on its own so its
available to those.
2016-05-27 14:56:47 -07:00

12 lines
325 B
Fish

# 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