fork/fish-shell
git clone https://git.julia.blue/fork/fish-shell
d835c5252
master
1# localization: tier3 2function __fish_print_user_ids 3if command -sq getent 4for linein ( getent passwd) 5set -l v( string split : --$line ) 6printf "%s\t%s\n" $v [ 3 ] $v [ 1 ] 7end 8end 9end 10 11function __fish_print_group_ids 12if command -sq getent 13for linein ( getent group) 14set -l v( string split : --$line ) 15printf "%s\t%s\n" $v [ 3 ] $v [ 1 ] 16end 17end 18end 19 20function __fish_complete_mount_opts 21set -l fish_mount_opts\ 22 async\t'Use asynchronous I/O' \ 23 atime\t'Update time on each access' \ 24 noatime\t'Do not update time on each access' \ 25 auto\t'Mounted with' \ 26 noauto\t'Not mounted by -a' \ 27 defaults\t'Use default options' \ 28 dev\t'Interpret character/block special devices' \ 29 nodev\t'Do not interpret character/block special devices' \ 30 diratime\t'Update directory inode access time' \ 31 nodiratime\t'Don\'t update directory inode access time' \ 32 dirsync\t'Use synchronous directory operations' \ 33 exec\t'Permit executables' \ 34 noexec\t'Do not permit executables' \ 35 group\t'Any user within device group may mount' \ 36 iversion\t'Increment i_version field on inode modification' \ 37 noiversion\t'Don\'t increment i_version field on inode modification' \ 38 mand\t'Allow mandatory locks' \ 39 nomand\t'Don\'t allow mandatory locks' \ 40 _netdev\t'Filesystem uses network' \ 41 nofail\t'Don\'t report errors' \ 42 relatime\t'Update inode access times' \ 43 norelatime\t'Don\'t update inode access times' \ 44 strictatime\ 45 nostrictatime\ 46 lazytime\ 47 nolazytime\ 48 suid\t'Allow suid bits' \ 49 nosuid\t'Ignore suid bits' \ 50 silent\ 51 loud\ 52 owner\ 53 remount\t'Remount read-only filesystem' \ 54 ro\t'Mount read-only' \ 55 rw\t'Mount read-write' \ 56 sync\t'Use synchronous I/O' \ 57 user\t'Any user may mount' \ 58 nouser\t'Only root may mount' \ 59 users\t'Any user may mount and unmount' \ 60 protect\ 61 usemp\ 62 verbose\ 63{ grp, no, usr,} quota\ 64 autodefrag\ 65 compress\ 66 compress-force\ 67 degraded\ 68 discard\ 69 enospc_debug\ 70 flushoncommit\ 71 inode_cache\ 72 context=\t'Set SELinux context' \ 73 uid=\ 74 gid=\ 75 ownmask=\ 76 othmask=\ 77 setuid=\ 78 setgid=\ 79 mode=\ 80 prefix=\ 81 volume=\ 82 reserved=\ 83 root=\ 84 bs=\ 85 alloc_start=\ 86 check_int{, _data, _print, _mask} =\ 87 commit=\ 88 compress=\ 89 compress-force=\ 90 device=\ 91 fatal_errors=\ 92 max_inline=\ 93 metadata_ratio=\ 94 noacl\ 95 nobarrier\ 96 nodatacow\ 97 nodatasum\ 98 notreelog\ 99 recovery\ 100 rescan_uuid_tree\ 101 skip_balance\ 102 nospace_cache\ 103 clear_cache\ 104 ssd\ 105 nossd\ 106 ssd_spread\ 107 subvol=\ 108 subvolrootid=\ 109 thread_pool=\ 110 user_subvol_rm_allowed\ 111 acl\ 112 noacl\ 113 bsddf\ 114 minixdf\ 115 check=none\ 116 nocheck\ 117 debug\ 118 errors={ continue, remount-ro, panic} \ 119 grpid\ 120 bsdgroups\ 121 bsdgroups\ 122 bsdgroups\ 123 nouid32\ 124 grpquota\ 125 grpquota\ 126 resgid=\ 127 resuid=\ 128 sb=\ 129{ user, nouser} _xattr\ 130 journal={ update, unum} \ 131 journal{ _dev, _path} =\ 132 norecovery\ 133 noload\ 134 data={ journal, ordered, writeback} \ 135 data_err={ ignore, abort} \ 136 barrier={ 0 , 1 } \ 137 user_xattr\ 138 acl 139 140set -l token( commandline -tc| string replace -r'^-o' --'' ) 141set -l args( string split , --$token ) 142 143if test ( count $args ) -ne 0 144set -l last_arg$args [ -1 ] 145set -e args[ -1 ] 146 147switch ( string replace -r'=.*' '=' --$last_arg ) 148case uid= 149set -a fish_mount_opts uid=( __fish_print_user_ids ) 150case gid= 151set -a fish_mount_opts gid=( __fish_print_group_ids ) 152case setuid= 153set -a fish_mount_opts setuid=( __fish_print_user_ids ) 154case setgid= 155set -a fish_mount_opts setgid=( __fish_print_group_ids ) 156end 157end 158 159set -l prefix'' 160if set -q args[ 1 ] 161set prefix( string join , --$args ) , 162end 163 164printf '%s\n' $prefix$fish_mount_opts 165end