Ricardo Wurmus (2017-07-26 10:59 +0200) wrote:

> Ludovic Courtès <l...@gnu.org> writes:
>
>> Ricardo Wurmus <rek...@elephly.net> skribis:
[...]
>>> This seems good to me.  I just wonder if there are legitimate cases
>>> where a package regexp would look like a command line option.  If that’s
>>> not the case could we just “unread” the argument and parse it as the
>>> next option?
>>
>> I thought about it but in theory “-” is perfectly legitimate, so I
>> thought we’d rather not try to be smart.  Thoughts?
>
> Is it really legitimate?  The regular expression is supposed to match on
> package names and we have no packages starting with “-”.  And even if we
> did (or the user has some oddly named packages in GUIX_PACKAGE_PATH),
> they could write “^-”.  Or we could demand that the argument be quoted
> (“'--foo'” or “"--foo"”) in that case.
>
> It just seems like a really rare edge case to *want* it to behave as it
> does now.

I am on "not try to be smart" side.  Mark described why "-foo" is a
legitimate regexp, so I think it's better to allow users to be free in a
choice of regexps.

-- 
Alex



Reply via email to