ruby-dev summary 25045-25260

T

Takaaki Tateishi

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.
 
A

Austin Ziegler

[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?

-austin
 
T

Takaaki Tateishi

Austin said:
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!.
 
N

nobu.nokada

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.
 
M

Minero Aoki

Hi,

In mail "Re: ruby-dev summary 25045-25260"
Austin Ziegler said:
[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:

Sun Dec 5 19:39:17 2004 Nobuyoshi Nakada <[email protected]>

* 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
 
A

Austin Ziegler

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?

-austin
 
M

Minero Aoki

Hi,

In mail "Re: ruby-dev summary 25045-25260"
Austin Ziegler said:
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
 
A

Austin Ziegler

[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
 
A

Aredridel

[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
 
N

nobu.nokada

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' }
 

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments. After that, you can post your question and our members will help you out.

Ask a Question

Members online

Forum statistics

Threads
473,744
Messages
2,569,484
Members
44,903
Latest member
orderPeak8CBDGummies

Latest Threads

Top