aboutsummaryrefslogtreecommitdiffhomepage
path: root/share/functions/__fish_complete_blockdevice.fish
blob: d07487decf7c64e223786db1a90f7054ade3c328 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
# 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