[Rake-devel] Balasan: [patch] non-destructive option parsing

Edwin Pratomo edpratomo at yahoo.co.id
Sat May 17 14:35:46 EDT 2008


--- Edwin Pratomo <edpratomo at yahoo.co.id> wrote:

> good day jim and all
> 
> currently rake uses getoptlong to parse command line options. the problem
> with
> this is that getoptlong destructively consumes ARGV, which means checking
> ARGV
> in a rakefile won't find any previously passed options. 
> 
> why would we need to check ARGV in rakefile? one possible case is to make use
> of rake's options such as -q or -v. so users might pass -qq or -vvv and a
> rakefile will print as much (or as little) output as those options are given.
> 
> so i'd suggest to use optparse instead, as optparse supports non-destructive
> parsing. 

attached is a patch for this. against svn trunk, rev 642.

rgds,
Edwin.



      ________________________________________________________ 
Bergabunglah dengan orang-orang yang berwawasan, di di bidang Anda! Kunjungi Yahoo! Answers saat ini juga di http://id.answers.yahoo.com/
-------------- next part --------------
A non-text attachment was scrubbed...
Name: rake-optparse.patch
Type: application/octet-stream
Size: 7675 bytes
Desc: 51425519-rake-optparse.patch
URL: <http://rubyforge.org/pipermail/rake-devel/attachments/20080518/eb9eda12/attachment.obj>


More information about the Rake-devel mailing list