Ruby-dev summary 25045-25260

Dear all,

Here is a brief summary of recent articles posted on ruby-dev.

[ruby-dev:25048] about optparse specification

  Minero Aoki claimed that optparse should not handle -L when --line
  is given. It appears that anyone is not interested in this issue,
  since there is no reply so far.

[ruby-dev:25075] status of defects

  Shugo Maeda informed us that status on bug reports listed at
  http://mput.dip.jp/rubybugs is automatically changed to 'fixed'
  when we put down a string like "[ruby-dev:12345]" into a commit
  log.

[ruby-dev:25101] non-stdio buffering

  Akira Tanaka summarized issues on non-stdio buffering, which is
  introduced for ruby-1.9. This new IO buffering mechanism affects
  some extension libraries.

[ruby-dev:25193] 1.8.2 release schedule

  Matz has a plan to release ruby-1.8.2 on Dec 24.

···

--
Takaaki Tateishi <ttate@ttsky.net>

Can you explain this a bit? If I do this:

  ARGV.options do |opts|
    opts.on('-L', '--line', ...) { |xx| ... }
  end

Then it should. However, IMO optparse should NOT autovivify -L if I
specify:

  ARGV.options do |opts|
    opts.on('--line', ...) { |xx| ... }
  end

Or is this something else entirely?

-austin

···

On Thu, 23 Dec 2004 00:13:52 +0900, Takaaki Tateishi <ttate@ttsky.net> wrote:

[ruby-dev:25048] about optparse specification
  Minero Aoki claimed that optparse should not handle -L when --line
  is given. It appears that anyone is not interested in this issue,
  since there is no reply so far.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

[ruby-dev:25048] about optparse specification

  Minero Aoki claimed that optparse should not handle -L when --line
  is given. It appears that anyone is not interested in this issue,
  since there is no reply so far.

Ach, that would totally throw me for a loop. I would expect -L to be
totally separate. I agree with Minero Aoki.

Ari

Austin Ziegler wrote:

Then it should. However, IMO optparse should NOT autovivify -L if I
specify:

  ARGV.options do |opts|
    opts.on('--line', ...) { |xx| ... }
  end

That's just it except for missing opts.parse!.

···

--
Takaaki Tateishi <ttate@ttsky.net>

Hi,

At Thu, 23 Dec 2004 00:28:15 +0900,
Austin Ziegler wrote in [ruby-talk:124301]:

> [ruby-dev:25048] about optparse specification
> Minero Aoki claimed that optparse should not handle -L when --line
> is given. It appears that anyone is not interested in this issue,
> since there is no reply so far.

Can you explain this a bit? If I do this:

  ARGV.options do |opts|
    opts.on('-L', '--line', ...) { |xx| ... }
  end

Then it should. However, IMO optparse should NOT autovivify -L if I
specify:

  ARGV.options do |opts|
    opts.on('--line', ...) { |xx| ... }
  end

Or is this something else entirely?

Yes, and I'd changed the behavior as you and Aoki claimed.

···

--
Nobu Nakada

Hi,

  In mail "Re: ruby-dev summary 25045-25260"

> [ruby-dev:25048] about optparse specification
> Minero Aoki claimed that optparse should not handle -L when --line
> is given. It appears that anyone is not interested in this issue,
> since there is no reply so far.

Can you explain this a bit? If I do this:

  ARGV.options do |opts|
    opts.on('-L', '--line', ...) { |xx| ... }
  end

Then it should. However, IMO optparse should NOT autovivify -L if I
specify:

  ARGV.options do |opts|
    opts.on('--line', ...) { |xx| ... }
  end

I said latter. From ruby-dev:25048:

  ~ % cat t
  require 'optparse'
  parser = OptionParser.new
  parser.on('--line') {
    puts 'opt=--line'
  }
  parser.parse!

  ~ % ruby t -l
  opt=--line
  ~ % ruby t --l
  opt=--line
  ~ % ruby t -L
  opt=--line
  ~ % ruby t --L
  opt=--line

But, thanks for nobu, it seems that optparse.rb was modified after
[ruby-dev:25048] was posted. We get following result now:

  % cat t
  require 'optparse'

  parser = OptionParser.new
  parser.on('--line') {
    puts 'opt=--line'
  }
  parser.parse!

  % ruby t -L
  /usr/lib/ruby/1.9/optparse.rb:1440:in `complete': invalid option: -L (OptionParser::InvalidOption)
    from /usr/lib/ruby/1.9/optparse.rb:1438:in `catch'
    from /usr/lib/ruby/1.9/optparse.rb:1438:in `complete'
    from /usr/lib/ruby/1.9/optparse.rb:1297:in `order!'
    from /usr/lib/ruby/1.9/optparse.rb:1266:in `catch'
    from /usr/lib/ruby/1.9/optparse.rb:1266:in `order!'
    from /usr/lib/ruby/1.9/optparse.rb:1346:in `permute!'
    from /usr/lib/ruby/1.9/optparse.rb:1373:in `parse!'
    from t:7

From ChangeLog:

···

Austin Ziegler <halostatue@gmail.com> wrote:

Sun Dec 5 19:39:17 2004 Nobuyoshi Nakada <nobu@ruby-lang.org>

        * lib/optparse.rb (OptionParser::Completion#complete): new parameter
          to direct case insensitiveness.

        * lib/optparse.rb (OptionParser#order!): ignore case only for long
          option. [ruby-dev:25048]

Regards,
Minero Aoki

Well, yes. So if I have --line, will optparse do -L automatically, or
will it not? And what was Minero wanting from this if it doesn't do -L
automatically?

-austin

···

On Thu, 23 Dec 2004 00:53:08 +0900, Takaaki Tateishi <ttate@ttsky.net> wrote:

Austin Ziegler wrote:
> Then it should. However, IMO optparse should NOT autovivify -L if I
> specify:
>
> ARGV.options do |opts|
> opts.on('--line', ...) { |xx| ... }
> end

That's just it except for missing opts.parse!.

--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

[ruby-dev:25048] about optparse specification
  Minero Aoki claimed that optparse should not handle -L when
  --line is given. It appears that anyone is not interested in
  this issue, since there is no reply so far.

Can you explain this a bit? If I do this:

[...]

I said latter. From ruby-dev:25048:

  ~ % cat t
  require 'optparse'
  parser = OptionParser.new
  parser.on('--line') {
    puts 'opt=--line'
  }
  parser.parse!

  ~ % ruby t -l
  opt=--line
  ~ % ruby t --l
  opt=--line
  ~ % ruby t -L
  opt=--line
  ~ % ruby t --L
  opt=--line

But, thanks for nobu, it seems that optparse.rb was modified after
[ruby-dev:25048] was posted. We get following result now:

Excellent!

If one wants something similar to this, couldn't one do:

  require 'optparse'

  parser = Option.parser.new
  parser.on('--l[ine]') { puts 'opt=--l[ine]' }
  parser.parse!

?

Thanks muchly,
-austin

···

On Thu, 23 Dec 2004 00:56:12 +0900, Minero Aoki <aamine@loveruby.net> wrote:
--
Austin Ziegler * halostatue@gmail.com
               * Alternate: austin@halostatue.ca

Hi,

  In mail "Re: ruby-dev summary 25045-25260"

···

Austin Ziegler <halostatue@gmail.com> wrote:

> > Then it should. However, IMO optparse should NOT autovivify -L if I
> > specify:
> >
> > ARGV.options do |opts|
> > opts.on('--line', ...) { |xx| ... }
> > end
>
> That's just it except for missing opts.parse!.

Well, yes. So if I have --line, will optparse do -L automatically, or
will it not? And what was Minero wanting from this if it doesn't do -L
automatically?

-L should raise error (and it does).

Regards,
Minero Aoki

Hi,

At Thu, 23 Dec 2004 01:02:32 +0900,
Austin Ziegler wrote in [ruby-talk:124317]:

If one wants something similar to this, couldn't one do:

  require 'optparse'

  parser = Option.parser.new
  parser.on('--l[ine]') { puts 'opt=--l[ine]' }
  parser.parse!

?

Making -L equal to --line?

  parser.on('--line', '-L') { puts 'opt=--line' }

···

--
Nobu Nakada