fish-shell/share/functions/__fish_complete_blockdevice.fish
Fabian Homborg 0fdef958b6 __fish_complete_blockdevice: Default to /dev
This gives all the blockdevices for `mount `

Fixes #7543.
2020-12-11 23:09:16 +01:00

12 lines
332 B
Fish

# Helper function for completions that need to enumerate block devices.
function __fish_complete_blockdevice
set -l cmd (commandline -ct)
test "" = "$cmd"
and set cmd /dev/
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