fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
d835c5252
master
1# localization: tier3 2function __fish_complete_zfs_rw_properties 3set -l OS"" 4switch ( uname ) 5case Linux 6set OS Linux 7case Darwin 8set OS macOS 9case FreeBSD 10set OS FreeBSD 11case SunOS 12set OS SunOS 13# Others? 14case "*" 15set OS unknown 16end 17echo -e"aclinherit\tInheritance of ACL entries (discard, noallow, restricted, passthrough, passthrough-x)" 18echo -e"atime\tUpdate access time on read (on, off)" 19echo -e"canmount\tIs the dataset mountable (on, off, noauto)" 20set -l additional_algs'' 21if contains --$OS FreeBSD SunOS 22set additional_algs" $additional_algs , noparity" 23end 24if __fish_is_zfs_feature_enabled "feature@sha512" 25set additional_algs" $additional_algs , sha512" 26end 27if __fish_is_zfs_feature_enabled "feature@skein" 28set additional_algs" $additional_algs , skein" 29end 30if __fish_is_zfs_feature_enabled "feature@edonr" 31set additional_algs" $additional_algs , edonr" 32end 33echo -e"checksum\tData checksum (on, off, fletcher2, fletcher4, sha256 $additional_algs )" 34if __fish_is_zfs_feature_enabled "feature@lz4_compress" 35set additional_algs", lz4" 36end 37echo -e"compression\tCompression algorithm (on, off, lzjb $additional_algs , gzip, gzip-[1-9], zle)" 38set -e additional_algs 39echo -e"copies\tNumber of copies of data (1, 2, 3)" 40echo -e"dedup\tDeduplication (on, off, verify, sha256[,verify])" 41echo -e"devices\tAre contained device nodes openable (on, off)" 42echo -e"exec\tCan contained executables be executed (on, off)" 43echo -e"filesystem_limit\tMax number of filesystems and volumes (COUNT, none)" 44echo -e"mountpoint\tMountpoint (PATH, none, legacy)" 45echo -e"primarycache\tWhich data to cache in ARC (all, none, metadata)" 46echo -e"quota\tMax size of dataset and children (SIZE, none)" 47echo -e"snapshot_limit\tMax number of snapshots (COUNT, none)" 48echo -e"readonly\tRead-only (on, off)" 49echo -e"recordsize\tSuggest block size (SIZE)" 50echo -e"redundant_metadata\tHow redundant are the metadata (all, most)" 51echo -e"refquota\tMax space used by dataset itself (SIZE, none)" 52echo -e"refreservation\tMin space guaranteed to dataset itself (SIZE, none)" 53echo -e"reservation\tMin space guaranteed to dataset (SIZE, none)" 54echo -e"secondarycache\tWhich data to cache in L2ARC (all, none, metadata)" 55echo -e"setuid\tRespect set-UID bit (on, off)" 56echo -e"sharenfs\tShare in NFS (on, off, OPTS)" 57echo -e"logbias\tHint for handling of synchronous requests (latency, throughput)" 58echo -e"snapdir\tHide .zfs directory (hidden, visible)" 59echo -e"sync\tHandle of synchronous requests (standard, always, disabled)" 60echo -e"volsize\tVolume logical size (SIZE)" 61 62# Autogenerate userquota@$USER list; only usernames are supported by the completion, but the zfs command supports more formats 63for userin ( __fish_print_users ) 64set -l tabAndBefore( echo -e"userquota@ $user \t" ) 65printf "%sMax usage by user %s\n" $tabAndBefore $user 66end 67# Autogenerate groupquota@$USER list 68for groupin ( __fish_print_groups ) 69set -l tabAndBefore( echo -e"groupquota@ $group \t" ) 70printf "%sMax usage by group %s\n" $tabAndBefore $group 71end 72if test $OS = SunOS 73echo -e"aclmode\tHow is ACL modified by chmod (discard, groupmask, passthrough, restricted)" 74echo -e"mlslabel\tCan the dataset be mounted in a zone with Trusted Extensions enabled (LABEL, none)" 75echo -e"nbmand\tMount with Non Blocking mandatory locks (on, off)" 76echo -e"sharesmb\tShare in Samba (on, off)" 77echo -e"shareiscsi\tShare as an iSCSI target (on, off)" 78echo -e"version\tOn-disk version of filesystem (1, 2, current)" 79echo -e"vscan\tScan regular files for viruses on opening and closing (on, off)" 80echo -e"xattr\tExtended attributes (on, off, sa)" 81echo -e"zoned\tManaged from a non-global zone (on, off)" 82else if test $OS = Linux 83echo -e"acltype\tUse no ACL or POSIX ACL (noacl, posixacl)" 84echo -e"nbmand\tMount with Non Blocking mandatory locks (on, off)" 85echo -e"relatime\tSometimes update access time on read (on, off)" 86echo -e"shareiscsi\tShare as an iSCSI target (on, off)" 87echo -e"sharesmb\tShare in Samba (on, off)" 88echo -e"snapdev\tHide volume snapshots (hidden, visible)" 89echo -e"version\tOn-disk version of filesystem (1, 2, current)" 90echo -e"vscan\tScan regular files for viruses on opening and closing (on, off)" 91echo -e"xattr\tExtended attributes (on, off, sa)" 92else if test $OS = FreeBSD 93echo -e"aclmode\tHow is ACL modified by chmod (discard, groupmask, passthrough, restricted)" 94echo -e"volmode\tHow to expose volumes to OS (default, geom, dev, none)" 95end 96# User properties; the /dev/null redirection masks the possible "no datasets available" 97zfs list -o all2> /dev/null| head -n1 | string replace -a -r"\s+" "\n" | string match -e":" | string lower 98end