* Suggestion: chmod +x auto completion only completes files that do not have executable permission
@ 2012-05-18 8:56 Hong Xu
2012-05-21 16:19 ` Bart Schaefer
0 siblings, 1 reply; 3+ messages in thread
From: Hong Xu @ 2012-05-18 8:56 UTC (permalink / raw)
To: zsh-workers
Hi,
I have a suggestion about chmod auto completion here. We could complete only chmod +x with files that do not have executable permission, and vice versa. We could also apply this rule to chmod +r, chmod +w, etc. What do you think?
Hong
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Suggestion: chmod +x auto completion only completes files that do not have executable permission
2012-05-18 8:56 Suggestion: chmod +x auto completion only completes files that do not have executable permission Hong Xu
@ 2012-05-21 16:19 ` Bart Schaefer
2012-05-22 8:31 ` Hong Xu
0 siblings, 1 reply; 3+ messages in thread
From: Bart Schaefer @ 2012-05-21 16:19 UTC (permalink / raw)
To: Hong Xu, zsh-workers@zsh.org
On May 18, 4:56pm, Hong Xu wrote:
}
} I have a suggestion about chmod auto completion here. We could
} complete only chmod +x with files that do not have executable
} permission, and vice versa. We could also apply this rule to chmod +r,
} chmod +w, etc. What do you think?
As far as I can tell, chmod completion already does this. _chmod has
this snippet:
for spec in ${(s:,:)words[2]}
do
if [[ ${spec#*[+-=]} != [rwxst]## ]]
then
_files && ret=0
return ret
fi
specs+=(${${(M)spec##[+-=]*}:+a}$spec)
done
_wanted files expl file _files -g "*(-.^f:${(j.,.)specs}:)" && ret=0
Do you have a case where it's failing?
^ permalink raw reply [flat|nested] 3+ messages in thread
* Re: Suggestion: chmod +x auto completion only completes files that do not have executable permission
2012-05-21 16:19 ` Bart Schaefer
@ 2012-05-22 8:31 ` Hong Xu
0 siblings, 0 replies; 3+ messages in thread
From: Hong Xu @ 2012-05-22 8:31 UTC (permalink / raw)
To: Bart Schaefer; +Cc: zsh-workers
On 05/22/2012 12:19 AM, Bart Schaefer wrote:
> On May 18, 4:56pm, Hong Xu wrote:
> }
> } I have a suggestion about chmod auto completion here. We could
> } complete only chmod +x with files that do not have executable
> } permission, and vice versa. We could also apply this rule to chmod +r,
> } chmod +w, etc. What do you think?
>
> As far as I can tell, chmod completion already does this. _chmod has
> this snippet:
>
> for spec in ${(s:,:)words[2]}
> do
> if [[ ${spec#*[+-=]} != [rwxst]## ]]
> then
> _files&& ret=0
> return ret
> fi
> specs+=(${${(M)spec##[+-=]*}:+a}$spec)
> done
> _wanted files expl file _files -g "*(-.^f:${(j.,.)specs}:)"&& ret=0
>
> Do you have a case where it's failing?
Weird, now it works for me like a charm. Thanks anyway!
Hong
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2012-05-22 8:32 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2012-05-18 8:56 Suggestion: chmod +x auto completion only completes files that do not have executable permission Hong Xu
2012-05-21 16:19 ` Bart Schaefer
2012-05-22 8:31 ` Hong Xu
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).