From: Daniel Shahaf <d.s@daniel.shahaf.name>
To: zsh-workers@zsh.org
Subject: Re: [PATCH] sshfs -o options completion
Date: Thu, 13 Aug 2015 23:57:07 +0000 [thread overview]
Message-ID: <20150813235707.GL1998@tarsus.local2> (raw)
In-Reply-To: <20150811220231.GC1859@tarsus.local2>
Daniel Shahaf wrote on Tue, Aug 11, 2015 at 22:02:31 +0000:
> The "action" part of the -o spec didn't escape colons.
Fixed to localize $curcontext and set $ret correctly (thanks to Oliver
for the review):
diff --git a/Completion/Linux/Command/_sshfs b/Completion/Linux/Command/_sshfs
index c6a8e10..e6d1370 100644
--- a/Completion/Linux/Command/_sshfs
+++ b/Completion/Linux/Command/_sshfs
@@ -1,14 +1,39 @@
#compdef sshfs
-_arguments \
+local context state state_descr line
+typeset -A opt_args
+local curcontext="$curcontext"
+integer ret=1
+
+_arguments -C \
'-V[version]' \
'-p:tcp port:' \
'-C[compression]' \
- '-o:options:_values -s , "sshfs or fuse or mount options" reconnect sshfs_sync no_readahead sshfs_debug cache=:cache\ setting:(yes no) cache_timeout=:seconds: cache_stat_timeout=:seconds: cache_dir_timeout=:seconds: cache_link_timeout=:seconds: ssh_command=:ssh\ command:_command_names directport=:port: SSHOPT=:ssh\ option: default_permissions allow_other allow_root kernel_cache large_read direct_io max_read=:size: hard_remove debug fs_name=:name: use_ino readdir_ino' \
+ '-o:options:->options' \
'-d[debug]' \
'-f[foreground]' \
'-s[disable multithreaded operation]' \
'-r[mount read-only]' \
'-h[help]' \
':remote directory:_user_at_host -S:' \
- ':mountpoint:_files -/'
+ ':mountpoint:_files -/' && ret=0
+
+if [[ $state == options ]]; then
+ _values -s , "sshfs or fuse or mount options" \
+ reconnect sshfs_sync no_readahead sshfs_debug \
+ 'cache=:cache setting:(yes no)' \
+ cache_timeout=:seconds: \
+ cache_stat_timeout=:seconds: \
+ cache_dir_timeout=:seconds: \
+ cache_link_timeout=:seconds: \
+ 'ssh_command=:ssh command:_command_names' \
+ directport=:port: \
+ 'SSHOPT=:ssh option:' \
+ default_permissions allow_other allow_root kernel_cache large_read direct_io \
+ max_read=:size: \
+ hard_remove debug \
+ fs_name=:name: \
+ use_ino readdir_ino && ret=0
+fi
+
+return ret
prev parent reply other threads:[~2015-08-13 23:57 UTC|newest]
Thread overview: 2+ messages / expand[flat|nested] mbox.gz Atom feed top
2015-08-11 22:02 Daniel Shahaf
2015-08-13 23:57 ` Daniel Shahaf [this message]
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20150813235707.GL1998@tarsus.local2 \
--to=d.s@daniel.shahaf.name \
--cc=zsh-workers@zsh.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
Code repositories for project(s) associated with this public inbox
https://git.vuxu.org/mirror/zsh/
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).