fork/fish-shell

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

Johannes Altmanninger__fish_complete_list: strip "--foo=" prefix from replacing completions320ebb685

master
2.6 KiB48 linesraw
1# losetup - Set up and control loop devices.
2#
3# This is part of the util-linux package.
4# https://www.kernel.org/pub/linux/utils/util-linux
5
6function __fish_print_losetup_list_output
7    printf "%s\t%s\n" \
8        NAME "Loop device name" \
9        AUTOCLEAR "Autoclear flag set" \
10        BACK-FILE "Device backing file" \
11        BACK-INO "Backing file inode number" \
12        BACK-MAJ:MIN "Backing file major:minor device number" \
13        MAJ:MIN "Loop device major:minor number" \
14        OFFSET "Offset from the beginning" \
15        PARTSCAN "Partscan flag set" \
16        RO "Read-only device" \
17        SIZELIMIT "Size limit of the file in bytes" \
18        DIO "Access backing file with direct-io" \
19        LOG-SEC "Logical sector size in bytes"
20end
21
22function __fish_print_losetup_attached
23    losetup --list --raw --noheadings --output NAME,BACK-FILE | string replace ' ' \t
24end
25
26complete -c losetup -s a -l all -d "List all used devices"
27complete -c losetup -s d -l detach -x -a "(__fish_print_losetup_attached)" -d "Detach one or more devices"
28complete -c losetup -s D -l detach-all -d "Detach all used devices"
29complete -c losetup -s f -l find -d "Find first unused device"
30complete -c losetup -s c -l set-capacity -x -a "(__fish_print_losetup_attached)" -d "Resize the device"
31complete -c losetup -s j -l associated -r -d "List all devices associated with given file"
32complete -c losetup -s L -l nooverlap -d "Avoid possible conflict between devices"
33complete -c losetup -s o -l offset -x -d "Start at given offset into file"
34complete -c losetup -l sizelimit -x -d "Device is limited to give bytes of the file"
35complete -c losetup -s b -l sector-size -x -d "Set the logical sector size"
36complete -c losetup -s P -l partscan -d "Create a partitioned loop device"
37complete -c losetup -s r -l read-only -d "Set up a read-only loop device"
38complete -c losetup -l direct-io -x -a "on off" -d "open backing file with O_DIRECT"
39complete -c losetup -l show -d "Print device name after setup"
40complete -c losetup -s v -l verbose -d "Verbose mode"
41complete -c losetup -s J -l json -d "Use JSON --list output format"
42complete -c losetup -s l -l list -d "List info about all or specified"
43complete -c losetup -s n -l noheadings -d "Don't print headings for --list output"
44complete -c losetup -s O -l output -x -a "(__fish_stripprefix='^(--output=|-\w*O)' __fish_complete_list , __fish_print_losetup_list_output)" -d "Specify columns to output for --list"
45complete -c losetup -l output-all -d "Output all columns"
46complete -c losetup -l raw -d "Use raw --list output format"
47complete -c losetup -s h -l help -d "Display help"
48complete -c losetup -s V -l version -d "Display version"