diff options
author | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-10 07:05:19 +0000 |
---|---|---|
committer | matz <matz@b2dd03c8-39d4-4d8f-98ff-823fe69b080e> | 2004-03-10 07:05:19 +0000 |
commit | 207ffc2d0afbf4f8c46368e63a4db407fe636ece (patch) | |
tree | 9832727d5254de4909d2e1a2a5e497bb06c5d8e9 /lib | |
parent | daa384e1d0a1bbade2072a4f19a005cf1b8be051 (diff) | |
download | ruby-207ffc2d0afbf4f8c46368e63a4db407fe636ece.tar.gz ruby-207ffc2d0afbf4f8c46368e63a4db407fe636ece.tar.xz ruby-207ffc2d0afbf4f8c46368e63a4db407fe636ece.zip |
* struct.c (rb_struct_s_def): Struct::new executes block with
generated struct class. [ruby-talk:02606]
* io.c (rb_io_ungetc): raise IOError instead of calling
rb_sys_fail(). [ruby-talk:23181]
git-svn-id: http://svn.ruby-lang.org/repos/ruby/trunk@5934 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
Diffstat (limited to 'lib')
-rw-r--r-- | lib/getoptlong.rb | 14 | ||||
-rw-r--r-- | lib/irb/completion.rb | 2 |
2 files changed, 8 insertions, 8 deletions
diff --git a/lib/getoptlong.rb b/lib/getoptlong.rb index 7bb9baef2..979554ad3 100644 --- a/lib/getoptlong.rb +++ b/lib/getoptlong.rb @@ -34,7 +34,7 @@ class GetoptLong # Error types. # class Error < StandardError; end - class AmbigousOption < Error; end + class AmbiguousOption < Error; end class NeedlessArgument < Error; end class MissingArgument < Error; end class InvalidOption < Error; end @@ -208,7 +208,7 @@ class GetoptLong end # - # Set/Unset `quit' mode. + # Set/Unset `quiet' mode. # attr_writer :quiet @@ -351,16 +351,16 @@ class GetoptLong # The option `option_name' is not registered in `@canonical_names'. # It may be an abbreviated. # - match_count = 0 + matches = [] @canonical_names.each_key do |key| if key.index(pattern) == 0 option_name = key - match_count += 1 + matches << key end end - if 2 <= match_count - set_error(AmbigousOption, "option `#{argument}' is ambiguous") - elsif match_count == 0 + if 2 <= matches.length + set_error(AmbiguousOption, "option `#{argument}' is ambiguous between #{matches.join(', ')}") + elsif matches.length == 0 set_error(InvalidOption, "unrecognized option `#{argument}'") end end diff --git a/lib/irb/completion.rb b/lib/irb/completion.rb index 46e6f24f3..e51a92adc 100644 --- a/lib/irb/completion.rb +++ b/lib/irb/completion.rb @@ -182,7 +182,7 @@ module IRB end if Readline.respond_to?("basic_word_break_characters=") - Readline.basic_word_break_characters= "\t\n\"\\'`><=;|&{(" + Readline.basic_word_break_characters= " \t\n\"\\'`><=;|&{(" end Readline.completion_append_character = nil Readline.completion_proc = IRB::InputCompletor::CompletionProc |