zsh-workers
 help / color / mirror / code / Atom feed
* Re: return code of _arguments
@ 2001-03-26  9:21 Sven Wischnowsky
  2001-03-26 14:05 ` Oliver Kiddle
  0 siblings, 1 reply; 4+ messages in thread
From: Sven Wischnowsky @ 2001-03-26  9:21 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Mar 23, 11:33pm, Oliver Kiddle wrote:
> } Subject: return code of _arguments
> }
> } If my understanding is correct the test [[ $? = 300 ]] after _arguments
> } is going to be equivalent to the test [[ -n $state ]]?
> 
> I suggested getting rid of the 300 return code once before.

Hm.  We could of course add an option to _arguments to make it return
300 when needed.  Non-_arguments-wrappers would call it without the
option...


Bye
 Sven


--
Sven Wischnowsky                         wischnow@informatik.hu-berlin.de


^ permalink raw reply	[flat|nested] 4+ messages in thread
* return code of _arguments
@ 2001-03-23 23:33 Oliver Kiddle
  2001-03-24 16:37 ` Bart Schaefer
  0 siblings, 1 reply; 4+ messages in thread
From: Oliver Kiddle @ 2001-03-23 23:33 UTC (permalink / raw)
  To: Zsh workers

In a couple of instances, I realised that despite _complete finding
matches, the _approximate completer was also being given a go. For
example, bzip2 --k<tab> was offering loads of other things besides
--keep.

The basic cause of this is that _bzip2 doesn't handle return codes of
300 from _arguments. This is a problem for any completion function
which uses a state machine action for any non-option spec (the *:... or
1:... specs) and is followed by && or || to determine the return code.
There are a good few.

If my understanding is correct the test [[ $? = 300 ]] after _arguments
is going to be equivalent to the test [[ -n $state ]]? The test appears
only twice - in _x_arguments and _xt_arguments so maybe this 300
feature isn't as useful as first anticipated by Sven. I therefore
wonder that the best thing to do here wouldn't be to remove the 300
return-code feature of _arguments and adapt the two functions which
rely on it.

Once we've resolved this, I'll rethink through the return codes for
many of the functions. In cases like _bzip2, the && return 0 is
actually quite handy because you need to use '--' first to compress
files whose names start with a -. If one of the options matched, the
current word must start with a - so we are better not to be completing
files. That said, I'd bet there are a number of functions where return
0 is used but we should be doing ret=0 -- especially any written by me
I fear.

Oliver


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

end of thread, other threads:[~2001-03-26 14:05 UTC | newest]

Thread overview: 4+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2001-03-26  9:21 return code of _arguments Sven Wischnowsky
2001-03-26 14:05 ` Oliver Kiddle
  -- strict thread matches above, loose matches on Subject: below --
2001-03-23 23:33 Oliver Kiddle
2001-03-24 16:37 ` Bart Schaefer

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