From c84137aec8043976a9c8deaf5206618abf0bef80 Mon Sep 17 00:00:00 2001 From: Clément Martinez Date: Tue, 7 Jun 2016 20:41:04 +0200 Subject: Clean netctl-auto and udiskctl completions --- share/completions/netctl-auto.fish | 4 +++- share/completions/udisksctl.fish | 13 +------------ 2 files changed, 4 insertions(+), 13 deletions(-) (limited to 'share') diff --git a/share/completions/netctl-auto.fish b/share/completions/netctl-auto.fish index 034c1642..90558c57 100644 --- a/share/completions/netctl-auto.fish +++ b/share/completions/netctl-auto.fish @@ -3,8 +3,10 @@ set -l cmds list store restore stop-all start stop restart switch-to status enab function __fish_print_netctl-auto_profile for line in (netctl-auto list) set -l profile (string sub -s 3 $line) - if [ (string sub -l 1 $line) = "*" ] + if string match -q '\**' -- $line printf "%s\t%s\n" $profile "Active profile" + else if string match -q "!*" -- $line + printf "%s\t%s\n" $profile "Disabled profile" else printf "%s\t%s\n" $profile "Profile" end diff --git a/share/completions/udisksctl.fish b/share/completions/udisksctl.fish index 60da7d52..f013b8e3 100644 --- a/share/completions/udisksctl.fish +++ b/share/completions/udisksctl.fish @@ -2,20 +2,9 @@ set -l cmds help info dump status monitor mount unmount unlock lock loop-setup l 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_complete_blockdevice - set -l cmd (commandline -ct) - [ "" = "$cmd" ] - and return - for f in $cmd* - [ -b $f ] - and printf "%s\t%s\n" $f "Block device" - [ -d $f ] - and printf "%s\n" $f/ - end -end function __fish_print_mounted_blockdevice - cat /proc/mounts | grep "^/.*" | cut -d " " -f 1 + grep "^/.*" /proc/mounts | cut -d " " -f 1 end complete -f -c udisksctl -n "__fish_seen_subcommand_from $cmds" -l help -d "Shows help" -- cgit v1.2.3