librelist archives

« back to archive

parse options with values

parse options with values

From:
Lee Capps
Date:
2010-11-24 @ 15:19
Hi,

I've been working on a formula [1] which requires options with values, e.g.

brew install plod --cryptcmd=bcrypt

I got feedback that options of that form (using '=') break 'brew
audit'. They don't break my 'brew audit', but okay -- I gather they
should, or at least that the preferred style would be something like

brew install plod --cryptcmd bcrypt

But I can't seem to get the latter to work, as bin/brew assumes the
values for my options are formulae and shifts them out of ARGV. So how
should I handle this? Could anyone point me to other formulae that use
options w/ values?

Thanks!

--
Lee

[1] https://github.com/mxcl/homebrew/pull/3225

Re: parse options with values

From:
Max Howell
Date:
2010-11-27 @ 13:06
        
        Seems like bin/brew should be fixed.Or fix audit.Or do --bcryptcmd
or something.But yes basically stuff needs fixing.
        
            Hi,I've been working on a formula [1] which requires options 
with values, e.g.brew install plod --cryptcmd=bcryptI got feedback that 
options of that form (using '=') break 'brewaudit'. They don't break my 
'brew audit', but okay -- I gather theyshould, or at least that the 
preferred style would be something likebrew install plod --cryptcmd 
bcryptBut I can't seem to get the latter to work, as bin/brew assumes 
thevalues for my options are formulae and shifts them out of ARGV. So 
howshould I handle this? Could anyone point me to other formulae that 
useoptions w/ values?Thanks!
    

Re: [homebrew] Re: parse options with values

From:
Lee Capps
Date:
2010-11-29 @ 17:02
Or perhaps this is rarely needed and not worth worrying about?

In my case, I've decided I was going about it wrong. The tool I'm
installing supports an RC file (though I'd never used one before), so
I've updated my formula[1] to make some educated guesses based on ENV
and then facilitate use of a user-edited RC file.

Thanks for the reply.


[1] 
https://github.com/jlcapps/homebrew/commit/b10fae6b384f6a3c4bdf3f5aa4bf0346e96e5e08

On Sat, Nov 27, 2010 at 8:06 AM, Max Howell <max@methylblue.com> wrote:
> Seems like bin/brew should be fixed.
>
> Or fix audit.
> Or do --bcryptcmd or something.
> But yes basically stuff needs fixing.
>
> Hi,
>
> I've been working on a formula [1] which requires options with values, e.g.
>
> brew install plod --cryptcmd=bcrypt
>
> I got feedback that options of that form (using '=') break 'brew
> audit'. They don't break my 'brew audit', but okay -- I gather they
> should, or at least that the preferred style would be something like
>
> brew install plod --cryptcmd bcrypt
>
> But I can't seem to get the latter to work, as bin/brew assumes the
> values for my options are formulae and shifts them out of ARGV. So how
> should I handle this? Could anyone point me to other formulae that use
> options w/ values?
>
> Thanks!
>
>