summaryrefslogtreecommitdiff
path: root/test/optparse
AgeCommit message (Collapse)Author
2019-11-29`LoadError` is not a subclass of `StandardError`Nobuyoshi Nakada
2019-10-21test/optparse/test_did_you_mean.rb - fix suggestion orderMSP-Greg
Notes: Merged: https://github.com/ruby/ruby/pull/2581
2019-10-18Support DidYouMean by AmbiguousOption tooNobuyoshi Nakada
2019-10-18Default DidYouMean.formatter to PlainFormatterNobuyoshi Nakada
2019-10-18Added no suggestion test caseNobuyoshi Nakada
2019-10-18Use DidYouMean.formatterNobuyoshi Nakada
Instead of building messages separately.
2019-10-18lib/optparse.rb: Show a did_you_mean hint for unknown optionYusuke Endoh
``` require 'optparse' OptionParser.new do |opts| opts.on("-f", "--foo", "foo") {|v| } opts.on("-b", "--bar", "bar") {|v| } opts.on("-c", "--baz", "baz") {|v| } end.parse! ``` ``` $ ruby test.rb --baa Traceback (most recent call last): test.rb:7:in `<main>': invalid option: --baa (OptionParser::InvalidOption) Did you mean? baz bar ``` Notes: Merged: https://github.com/ruby/ruby/pull/2561
2019-06-28Fixed the test-case class name for zshNobuyoshi Nakada
2019-05-15Allow --enable/--disable options to take an argumentNobuyoshi Nakada
[Bug #15850]
2018-05-06optparse: Suppress warningsnobu
Ruby warns "instance variable `@version` not initialized" for optparse when it receives `--version` option. `test.rb` ```ruby require 'optparse' Version = '1' OptionParser.new.parse(ARGV) ``` ``` $ ruby -w test.rb --version /home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1168: warning: instance variable @version not initialized /home/pocke/.rbenv/versions/2.5.1/lib/ruby/2.5.0/optparse.rb:1175: warning: instance variable @release not initialized test 1 ``` This change will suppress the warnings. [Fix GH-1871] From: Masataka Pocke Kuwabara <kuwabara@pocke.me> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63342 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2018-01-26optparse.rb: froze string literalsnobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-10-23multiple arguments to writenobu
Make write methods of IO-like objects accept multiple arguments, as well as IO#write. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@60383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-24optparse.rb: case-sensitive candidatenobu
* lib/optparse.rb (candidate): short options are case-sensitive by the default, should not match case-different options.. https://github.com/mernen/completion-ruby/pull/9#issuecomment-317287946 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59412 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-12optparse.rb: get rid of evalnobu
* lib/optparse.rb: try Float() and Integer() instead of eval, which does too much things. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59312 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2017-07-06Fix DecimalInteger converting to octal bugnobu
Previously if the input started with a '0' then it will be converted as octal even though it has been specified as a decimal. This commit forces the number to be interpreted as a decimal. [ruby-core:81927] [Bug #13722] [Fix GH-1665] Author: william <william.mccumstie@outlook.com> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59273 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-14optparse/kwargs.rbnobu
* lib/optparse/kwargs.rb (OptionParser#define_by_keywords): [EXPERIMENTAL] extract command line option definitions from the information of keyword arguments. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56423 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-10-14optparse.rb: hyphenizenobu
* lib/optparse.rb (make_switch, parse_in_order): unify underscores to hyphens. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@56419 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-05-31optparse.rb: fix char class optionnobu
* lib/optparse.rb (OptionParser::Completion.candidate): get rid of nil as key names. [ruby-core:75773] [Bug #12438] * lib/optparse.rb (OptionParser#make_switch): char class option cannot be NoArgument, default to RequiredArgument. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@55228 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2016-01-06optparse.rb: into kwdargnobu
* lib/optparse.rb (OptionParser#order!): add `into` optional keyword argument to store the results. [Feature #11191] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53444 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-12-16Add frozen_string_literal: false for all filesnaruse
When you change this to true, you may need to add more tests. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@53141 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2015-06-02use assert_raisenobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-09-05* lib/optparse.rb: The Integer acceptable now allows binary anddrbrain
hexadecimal numbers per the documentation. [ruby-trunk - Bug #8865] DecimalInteger, OctalInteger, DecimalNumeric now validate their input before converting to a number. [ruby-trunk - Bug #8865] * test/optparse/test_acceptable.rb: Tests for the above, tests for all numeric acceptables for existing behavior. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@42844 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2013-04-01test_optparse.rb: skip no_error in backtracenobu
* test/optparse/test_optparse.rb (TestOptionParser#assert_no_error): prefix with assert_ so it will be skipped in backtrace. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@40041 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-25* test/optparse/test_summary.rb (test_summary_containing_space): addnagachika
test for r35467. OptionParser#to_a shouldn't split banner by spaces. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35473 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24* lib/optparse.rb (OptionParser#to_a): split for each lines.nobu
[ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24* lib/optparse.rb (OptionParser#to_a): should split by end-of-linenobu
[ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-24* lib/optparse.rb (OptionParser#to_a): String#to_a is no longernobu
defined. [ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-04-02* lib/optparse/ac.rb: autoconf-like options.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2012-01-16* lib/optparse.rb (Regexp): fix incorrect options when casting tonobu
a Regexp, and suppress encoding option warnings. https://github.com/ruby/ruby/pull/82 git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@34316 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-19* lib/optparse.rb: shell completion support for zsh. based onnobu
<http://d.hatena.ne.jp/rubikitch/20071002/zshcomplete> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29834 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-11-19* lib/optparse.rb: shell completion support for bash.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-06-22* test/optparse/test_summary.rb: fixed superclass so that it runnobu
solely. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@28387 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2010-02-02use require_relative.akr
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@26542 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2009-04-26* lib/optparse.rb (OptionParser#parse_in_order): do not make annobu
option from non-option argument. [ruby-dev:38333] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@23286 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-26* lib/optparse.rb (OptionParser::List#summarize): gives prioritynobu
to latter switches. [ruby-dev:36692] * lib/optparse.rb (OptionParser#summarize): do not append unnecessary line terminator. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@21066 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-12-21* lib/optparse.rb (SPLAT_PROC): fix for regexp. [ruby-dev:37514]nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@20895 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2008-09-24* test: assert_raises has been deprecated since a long time ago.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@19536 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-10-03* test/optparse/test_getopts.rb: changed the class name of test casenobu
to get rid of conflict with test_optparse.rb. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11077 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-26* test/optparse/test_getopts.rb: added short and long tests.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11031 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2006-09-26* test/optparse/test_getopts.rb: added.nobu
git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@11030 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2004-12-05* lib/optparse.rb (OptionParser::Completion#complete): new parameternobu
to direct case insensitiveness. * lib/optparse.rb (OptionParser#order!): ignore case only for long option. [ruby-dev:25048] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@7464 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
2003-11-05* lib/optparse.rb (OptionParser::Switch::PlacedArgument::parse):nobu
do not remove next argument if empty value is placed. * test/optparse: added. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@4903 b2dd03c8-39d4-4d8f-98ff-823fe69b080e