zsh-workers
 help / color / mirror / code / Atom feed
* weird bit in _man
@ 2011-09-26 22:17 Mikael Magnusson
  2011-09-27  8:50 ` Oliver Kiddle
  0 siblings, 1 reply; 2+ messages in thread
From: Mikael Magnusson @ 2011-09-26 22:17 UTC (permalink / raw)
  To: zsh workers

  if [[ $service == man ]] && (( $words[(I)-l] +
$words[(I)--local-file] )); then
    _files || return 0
  fi

surely that should be && ? Or maybe even _files; return since it
doesn't make sense to complete manpages at all if -l is given. But
returning success if no files were completed and not offering any
manpages doesn't seem all that useful... Am I missing something?

-- 
Mikael Magnusson


^ permalink raw reply	[flat|nested] 2+ messages in thread

* Re: weird bit in _man
  2011-09-26 22:17 weird bit in _man Mikael Magnusson
@ 2011-09-27  8:50 ` Oliver Kiddle
  0 siblings, 0 replies; 2+ messages in thread
From: Oliver Kiddle @ 2011-09-27  8:50 UTC (permalink / raw)
  To: zsh workers

Mikael Magnusson wrote:
>     _files || return 0

> surely that should be && ? Or maybe even _files; return since it

I suspect that it is a mistake. The original patch doesn't provide much
clue. && was probably intended but as you say ; is better because you
wouldn't want to go on to complete man pages.  It could perhaps specify
a glob much as _mere does (although allowing for .gz extensions).

The problem with that as a fix is that on some systems man has a -l option
that is something other than view a local file. Or at least, on Solaris,
it prints all the matching manual pages with their section numbers and
location. Perhaps we need to use _pick_variant but I notice that man is
completely different on Debian and on OEL (Oracle's Redhat clone) so it
may not be trivial.

Oliver


^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2011-09-27  8:57 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2011-09-26 22:17 weird bit in _man Mikael Magnusson
2011-09-27  8:50 ` Oliver Kiddle

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).