zsh-workers
 help / color / mirror / code / Atom feed
* Re: PATCH: complete rpm --{resign,addsign} in local
@ 2000-06-06  9:56 Sven Wischnowsky
  0 siblings, 0 replies; 9+ messages in thread
From: Sven Wischnowsky @ 2000-06-06  9:56 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> ...
> 
> I don't think it's incumbent upon _arguments to handle this without help;
> that's exactly what the state machine is for.  It just has to be possible
> to tell _arguments that other option letters are allowed in the string of
> options even after one that has a following argument, so that it can go
> to the right next state.

Yep. Good.

> This could be done by something like `_arguments -s+ ...' if it's too
> awful to come up with still more OPTSPEC syntax (which I'm beginning to
> believe that it is).

I'll have a look...

> ...
> 
> Of course the compadd in _rpm needs a `-S ""' added to it.  Which reminds
> me ... I tried changing that compadd to be:
> 
> 	_alternative ... 'prefixes:URL prefix:compadd \ ftp://'
> 
> to try to force a leading space onto the command line, but what got put
> on the command line *included* the backslash.  What's up with that?  It
> works to put a backslashed space in the pattern for '_files -g ...'.

_path_files does it's own quoting. With compadd you get the usual
normalised quoted form. You can use -P ' ' or -i ' ' to prepend the
unquoted space, but of course, you'll then get one space per
completion attempt because following completions can't know that the
space came from a previous completion.

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: PATCH: complete rpm --{resign,addsign} in local
@ 2000-06-07  8:01 Sven Wischnowsky
  0 siblings, 0 replies; 9+ messages in thread
From: Sven Wischnowsky @ 2000-06-07  8:01 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Jun 5, 10:54am, Sven Wischnowsky wrote:
>
> ...
>  
> } What makes me cringe is the case where we have -xy and both options
> } have arguments...
> 
> You mean like `tar fvcbz foo.tar.gz 1024 foo'?
> 
> I don't think it's incumbent upon _arguments to handle this without help;
> that's exactly what the state machine is for.  It just has to be possible
> to tell _arguments that other option letters are allowed in the string of
> options even after one that has a following argument, so that it can go
> to the right next state.
> 
> This could be done by something like `_arguments -s+ ...' if it's too
> awful to come up with still more OPTSPEC syntax (which I'm beginning to
> believe that it is).

After thinking some more about this... I think we have to make
comparguments understand this because it has to be able to skip over
the arguments when completer after them. Right?

Maybe I'll have a look at this at the weekend.

Bye
 Sven


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


^ permalink raw reply	[flat|nested] 9+ messages in thread
* Re: PATCH: complete rpm --{resign,addsign} in local
@ 2000-06-05  8:54 Sven Wischnowsky
  2000-06-04 19:37 ` Chmouel Boudjnah
  0 siblings, 1 reply; 9+ messages in thread
From: Sven Wischnowsky @ 2000-06-05  8:54 UTC (permalink / raw)
  To: zsh-workers


Bart Schaefer wrote:

> On Jun 4,  5:09pm, Clint Adams wrote:
> } Subject: Re: PATCH: complete rpm --{resign,addsign} in local
> }
> } > Index: Completion/Linux/_rpm
> } 
> } zsh is still completing filenames directly after rpm -qcp or -qpc,
> } with no space, FWIW.
> 
> This is problematic.
> 
> Currently _rpm uses `-p+' as the spec for the -p option.  That means that
> anything that will follow the -p (including package file name) is allowed
> to appear in the same word, or in the next word.
> 
> If we remove the `+', then "rpm -qpc" doesn't match the spec `-p', and so
> completion doesn't enter the `package_file' state -- it instead enters the
> `package_or_file' state (the default spec from the `query' state).
> 
> If there's a clever workaround for this, I don't know it.  (Perhaps this
> is an indication of some lingering bugginess with `_arguments -s'?)

Hrm. So we have to make it complete option arguments in the next
word(s) even if the option string doesn't end in the option, right?

What makes me cringe is the case where we have -xy and both options
have arguments...

Bye
 Sven


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


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

end of thread, other threads:[~2000-06-07  8:02 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2000-06-06  9:56 PATCH: complete rpm --{resign,addsign} in local Sven Wischnowsky
  -- strict thread matches above, loose matches on Subject: below --
2000-06-07  8:01 Sven Wischnowsky
2000-06-05  8:54 Sven Wischnowsky
2000-06-04 19:37 ` Chmouel Boudjnah
2000-06-04 21:09   ` Clint Adams
2000-06-05  1:13     ` Bart Schaefer
2000-06-05  1:18   ` Bart Schaefer
2000-06-05  9:47     ` Oliver Kiddle
2000-06-05 15:03       ` 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).