From 3d56d7ee327b40f31954730b2a0001c2d98d31c5 Mon Sep 17 00:00:00 2001 From: axel Date: Wed, 25 Jan 2006 09:01:33 +1000 Subject: Add completions for sshfs, fusermount and sudo darcs-hash:20060124230133-ac50b-b6b8685b2c3771ec1699661de88ba45fe47df82d.gz --- init/completions/fusermount.fish | 17 +++++++++++++++++ init/completions/sshfs.fish | 33 +++++++++++++++++++++++++++++++++ init/completions/sudo.fish | 10 ++++++++++ 3 files changed, 60 insertions(+) create mode 100644 init/completions/fusermount.fish create mode 100644 init/completions/sshfs.fish create mode 100644 init/completions/sudo.fish (limited to 'init') diff --git a/init/completions/fusermount.fish b/init/completions/fusermount.fish new file mode 100644 index 00000000..56ddcd4e --- /dev/null +++ b/init/completions/fusermount.fish @@ -0,0 +1,17 @@ +# +# Completions for fusermount +# +# Find mount points, borrowed from umount.fish +# +complete -c fusermount -d (_ "Mount point") -x -a ' +( + cat /etc/mtab | grep "^sshfs" | cut -d " " -f 1-2|tr " " \n|sed -e "s/[0-9\.]*:\//\//"|grep "^/" +) +' + +complete -c fusermount -s h -d (_ "Display help and exit") +complete -c fusermount -s v -d (_ "Display version and exit") +complete -c fusermount -s o -x -d (_ "Mount options") +complete -c fusermount -s u -d (_ "Unmount") +complete -c fusermount -s q -d (_ "Quiet") +complete -c fusermount -s z -d (_ "Lazy unmount") diff --git a/init/completions/sshfs.fish b/init/completions/sshfs.fish new file mode 100644 index 00000000..76a31493 --- /dev/null +++ b/init/completions/sshfs.fish @@ -0,0 +1,33 @@ +# +# Completions for sshfs +# +# Host combinations, borrowed from ssh.fish +# +complete -x -c sshfs -d Hostname -a " + +(__fish_print_hostnames): + +( + #Prepend any username specified in the completion to the hostname + echo (commandline -ct)|sed -ne 's/\(.*@\).*/\1/p' +)(__fish_print_hostnames): + +(__fish_print_users)@ +" +# +# Mount Points, for neatness, I am only mounting under ~/mnt/ +# +complete -c sshfs -d (_ "Mount point") -x -a '(find ~/mnt -type d)' +# +# Command options +# +complete -c sshfs -s V -d (_ "Display version and exit") +complete -c sshfs -s p -x -d (_ "Port") +complete -c sshfs -s C -d (_ "Compression") +complete -c sshfs -s o -x -d (_ "Mount options") +complete -c sshfs -s d -d (_ "Enable debug") +complete -c sshfs -s f -d (_ "Foreground operation") +complete -c sshfs -s s -d (_ "Disable multi-threaded operation") +complete -c sshfs -s r -d (_ "Mount options") +complete -c sshfs -s h -d (_ "Display help and exit") + diff --git a/init/completions/sudo.fish b/init/completions/sudo.fish new file mode 100644 index 00000000..a041e1b0 --- /dev/null +++ b/init/completions/sudo.fish @@ -0,0 +1,10 @@ +# +# Completion for sudo +# +# Generate a list of commands +# + +complete -c sudo -d (_ "Command to run") -x -a "(__fish_complete_commands)" + +complete -c sudo -s h -d (_ "Display help and exit") +complete -c sudo -s v -d (_ "Validate") -- cgit v1.2.3