From cbea0b937824ab9e4ead17cdfa18220072bf81f8 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Cl=C3=A9ment=20Martinez?= Date: Sun, 12 Feb 2017 15:23:41 +0100 Subject: [PATCH] mount & udisksctl: improve `-o` completions` (#3764) * mount & udisksctl: improve `-o` completions` * Update __fish_complete_mount_opts --- share/completions/mount.fish | 7 +- share/completions/udisksctl.fish | 7 +- .../functions/__fish_complete_mount_opts.fish | 164 ++++++++++++++++++ 3 files changed, 167 insertions(+), 11 deletions(-) create mode 100644 share/functions/__fish_complete_mount_opts.fish diff --git a/share/completions/mount.fish b/share/completions/mount.fish index 9375a473e..c7dff53b0 100644 --- a/share/completions/mount.fish +++ b/share/completions/mount.fish @@ -24,9 +24,4 @@ complete -c mount -s O -x --description 'Exclude file systems' complete -c mount -l bind -f --description 'Remount a subtree to a second position' complete -c mount -l move -f --description 'Move a subtree to a new position' complete -c mount -x -s t --description 'File system' -a "(__fish_print_filesystems)" - -complete -c mount -x -s o --description 'Mount option' -a '(__fish_append , $__fish_mount_opts)' - -set -g __fish_mount_opts async\tUse\ asynchronous\ I/O atime\tUpdate\ time\ on\ each\ access auto\tMounted\ with\ -a defaults\tUse\ default\ options dev\tInterpret\ character/block\ special\ devices exec\tPermit\ executables _netdev\tFilesystem\ uses\ network noatime\tDo\ not\ update\ time\ on\ each\ access noauto\tNot\ mounted\ by\ -a nodev\tDo\ not\ interpret\ character/block\ special\ devices noexec\tDo\ not\ permit\ executables nosuid\tIgnore\ suid\ bits nouser\tOnly\ root\ may\ mount remount\tRemount\ read-only\ filesystem ro\tMount\ read-only rw\tMount\ read-write suid\tAllow\ suid\ bits sync\tUse\ synchronous\ I/O dirsync\tUse\ synchronous\ directory\ operations user\tAny\ user\ may\ mount users\tAny\ user\ may\ mount\ and\ unmount - - +complete -c mount -x -s o --description 'Mount option' -a '(__fish_complete_mount_opts)' diff --git a/share/completions/udisksctl.fish b/share/completions/udisksctl.fish index 1b3376c93..bb12f3280 100644 --- a/share/completions/udisksctl.fish +++ b/share/completions/udisksctl.fish @@ -1,11 +1,8 @@ set -l cmds help info dump status monitor mount unmount unlock lock loop-setup loop-delete power-off smart-simulate -set __fish_mount_opts async\tUse\ asynchronous\ I/O atime\tUpdate\ time\ on\ each\ access auto\tMounted\ with\ -a defaults\tUse\ default\ options dev\tInterpret\ character/block\ special\ devices exec\tPermit\ executables _netdev\tFilesystem\ uses\ network noatime\tDo\ not\ update\ time\ on\ each\ access noauto\tNot\ mounted\ by\ -a nodev\tDo\ not\ interpret\ character/block\ special\ devices noexec\tDo\ not\ permit\ executables nosuid\tIgnore\ suid\ bits nouser\tOnly\ root\ may\ mount remount\tRemount\ read-only\ filesystem ro\tMount\ read-only rw\tMount\ read-write suid\tAllow\ suid\ bits sync\tUse\ synchronous\ I/O dirsync\tUse\ synchronous\ directory\ operations user\tAny\ user\ may\ mount users\tAny\ user\ may\ mount\ and\ unmount - - function __fish_print_mounted_blockdevice if test -r /proc/mounts - string match -r "^/[^ ]*" < /proc/mounts + string match -r "^/[^ ]*"