fork/fish-shell

git clone https://git.julia.blue/fork/fish-shell

ridiculousfishRun fish_indent over new Windows completionsb8fd6b5f3

master
1.6 KiB42 linesraw
1function __attributes_disk_complete_args
2    if not __fish_seen_subcommand_from set clear
3        echo -e 'set\tSet the specified attribute of the disk with focus
4clear\tClear the specified attribute of the disk with focus'
5        return
6    end
7
8    echo -e 'readonly\tSpecify that the disk is read-only
9noerr\tWhen an error is encountered, DiskPart continues to process commands'
10end
11
12function __attributes_volume_complete_args
13    if not __fish_seen_subcommand_from set clear
14        echo -e 'set\tSet the specified attribute of the volume with focus
15clear\tClear the specified attribute of the volume with focus'
16        return
17    end
18
19    if not __fish_seen_subcommand_from readonly hidden nodefaultdriveletter shadowcopy
20        echo -e 'readonly\tSpecify that the volume is read-only
21hidden\tSpecify that the volume is hidden
22nodefaultdriveletter\tSpecify that the volume does not receive a drive letter by default
23shadowcopy\tSpecify that the volume is a shadow copy volume'
24    end
25
26    echo -e 'noerr\tWhen an error is encountered, DiskPart continues to process commands'
27end
28
29function __attributes_complete_args -d 'Function to generate args'
30    if __fish_seen_subcommand_from disk
31        __attributes_disk_complete_args
32    else if __fish_seen_subcommand_from volume
33        __attributes_volume_complete_args
34    end
35end
36
37complete -c attributes -f -a '(__attributes_complete_args)'
38
39complete -c attributes -f -n 'not __fish_seen_subcommand_from disk volume' -a disk \
40    -d 'Display, set, or clear the attributes of a disk'
41complete -c attributes -f -n 'not __fish_seen_subcommand_from dick volume' -a volume \
42    -d 'Display, set, or clear the attributes of a volume'