summaryrefslogtreecommitdiff
path: root/test/optparse
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/optparse] Add symbolize_names to getoptsJunichi Ito2022-12-261-0/+16
| | | | https://github.com/ruby/optparse/commit/3e63d878f8
* [ruby/optparse] The encoding argument of `Regexp.new` has been ignored since 1.9Nobuyoshi Nakada2022-12-211-0/+3
| | | | https://github.com/ruby/optparse/commit/766f567405
* [ruby/optparse] Fix the test failure i ruby/rubyYusuke Endoh2022-11-281-3/+3
| | | | | | | | | | | | | | | | | | | | | | | | ``` $ make test-all TESTS=test/optparse/ ... [148/178] TestOptionParserDidYouMean#test_raise_unknown = 0.00 s 1) Failure: TestOptionParserDidYouMean#test_raise_unknown [/home/mame/work/ruby/test/optparse/test_optparse.rb:106]: <["--bar"]> expected but was <[]>. ``` In the old test/unit (bundled in ruby/ruby), when a test class inherits from another test class, the child class runs all the tests defined in the parent class. However, it looks like the new test/unit does not do so. This is because the test failure does not occur in ruby/optparse. As a tentative solution, this changes the option names in TestOptionParser to avoid the name conflict with TestOptionParserDidYouMean. https://github.com/ruby/optparse/commit/fee86ef7a4
* [ruby/optparse] Add `raise_unknown` flagNobuyoshi Nakada2022-11-281-0/+12
| | | | | | (https://github.com/ruby/optparse/pull/38) https://github.com/ruby/optparse/commit/12529653cd
* [ruby/optparse] Add tests for `load(into:)`Nobuyoshi Nakada2022-10-291-0/+2
| | | | https://github.com/ruby/optparse/commit/51f7e060ee
* [ruby/optparse] Add tests for `OptionParser#load`Nobuyoshi Nakada2022-10-291-0/+139
| | | | https://github.com/ruby/optparse/commit/fb34a1d3a3
* [ruby/optparse] Don't treat empty string as an option descriptionMaciek Rząsa2022-10-081-0/+23
| | | | https://github.com/ruby/optparse/commit/078638ee6d
* [ruby/optparse] Also accept '-' as an optional argument ↵konsolebox2022-07-291-0/+6
| | | | | | (https://github.com/ruby/optparse/pull/35) https://github.com/ruby/optparse/commit/f2b8318631
* Avoid defining the same test class in multiple filesJeremy Evans2022-04-2213-29/+19
| | | | | | | | | Should fix issues with parallel testing sometimes not running all tests. This should be viewed skipping whitespace changes. Fixes [Bug #18731]
* [ruby/optparse] Fix for ruby 3.0 or earlierNobuyoshi Nakada2022-01-121-5/+5
| | | | https://github.com/ruby/optparse/commit/9e29d86c12
* [ruby/optparse] DidYouMean::PlainFormatter is deprecatedNobuyoshi Nakada2022-01-121-3/+11
| | | | https://github.com/ruby/optparse/commit/0ac9957696
* Revert "Revert "Replace an deprecated constant with a new one in did_you_mean""Yuki Nishijima2021-12-241-5/+1
| | | | This reverts commit 1527f7569b0412f3bc7ac98a3461e59a4891ed96.
* Revert "Replace an deprecated constant with a new one in did_you_mean"Yuki Nishijima2021-12-231-1/+5
| | | | This reverts commit 573d9d3a4a0f112379874cedf4e494515e4b3f15.
* Replace an deprecated constant with a new one in did_you_meanYuki Nishijima2021-12-221-5/+1
|
* [ruby/optparse] Fix typo [ci skip]Nobuyoshi Nakada2021-11-031-1/+1
| | | | https://github.com/ruby/optparse/commit/0aa18752cf
* Remove the test for DYM's verbose formatterYuki Nishijima2021-10-221-8/+0
|
* [ruby/optparse] Add EditorConfig fileAlexander Popov2021-04-281-1/+0
| | | | | | | | | | More info here: https://editorconfig.org/ For example, `ruby/ruby` has it: https://github.com/ruby/ruby/blob/05ebaee/.editorconfig Also fix some offenses. https://github.com/ruby/optparse/commit/29402e7e0e
* [ruby/optparse] Fixed error message of unparsed non-optionNobuyoshi Nakada2021-03-291-0/+8
| | | | | | Close https://github.com/ruby/optparse/issues/3 https://github.com/ruby/optparse/commit/94c5cf4032
* [ruby/optparse] Add OptionParser#require_exact accessorJeremy Evans2021-03-291-0/+22
| | | | | | | | | This allows you to disable allowing abbreviations of long options and using short options for long options. Implements Ruby Feature #11523 https://github.com/ruby/optparse/commit/dfefb2d2e2
* `LoadError` is not a subclass of `StandardError`Nobuyoshi Nakada2019-11-291-1/+5
|
* test/optparse/test_did_you_mean.rb - fix suggestion orderMSP-Greg2019-10-211-3/+3
|
* Support DidYouMean by AmbiguousOption tooNobuyoshi Nakada2019-10-181-0/+6
|
* Default DidYouMean.formatter to PlainFormatterNobuyoshi Nakada2019-10-181-1/+5
|
* Added no suggestion test caseNobuyoshi Nakada2019-10-181-0/+5
|
* Use DidYouMean.formatterNobuyoshi Nakada2019-10-181-7/+18
| | | | Instead of building messages separately.
* lib/optparse.rb: Show a did_you_mean hint for unknown optionYusuke Endoh2019-10-181-0/+22
| | | | | | | | | | | | | | | | | | | | ``` 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 ```
* Fixed the test-case class name for zshNobuyoshi Nakada2019-06-281-1/+1
|
* Allow --enable/--disable options to take an argumentNobuyoshi Nakada2019-05-151-0/+7
| | | | [Bug #15850]
* optparse: Suppress warningsnobu2018-05-061-0/+2
| | | | | | | | | | | | | | | | | | | | | | | | | | | 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
* optparse.rb: froze string literalsnobu2018-01-261-0/+9
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* multiple arguments to writenobu2017-10-233-3/+3
| | | | | | | 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
* optparse.rb: case-sensitive candidatenobu2017-07-241-0/+5
| | | | | | | | * 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
* optparse.rb: get rid of evalnobu2017-07-121-0/+3
| | | | | | | * 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
* Fix DecimalInteger converting to octal bugnobu2017-07-061-6/+6
| | | | | | | | | | | 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
* optparse/kwargs.rbnobu2016-10-141-0/+40
| | | | | | | | * 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
* optparse.rb: hyphenizenobu2016-10-144-0/+64
| | | | | | | * 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
* optparse.rb: fix char class optionnobu2016-05-311-0/+18
| | | | | | | | | * 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
* optparse.rb: into kwdargnobu2016-01-061-0/+11
| | | | | | | * 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
* Add frozen_string_literal: false for all filesnaruse2015-12-1611-0/+11
| | | | | | 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
* use assert_raisenobu2015-06-021-21/+21
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@50727 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse.rb: The Integer acceptable now allows binary anddrbrain2013-09-051-0/+195
| | | | | | | | | | | | | 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
* test_optparse.rb: skip no_error in backtracenobu2013-04-011-1/+2
| | | | | | | * 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
* * test/optparse/test_summary.rb (test_summary_containing_space): addnagachika2012-04-251-0/+8
| | | | | | 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
* * lib/optparse.rb (OptionParser#to_a): split for each lines.nobu2012-04-241-1/+1
| | | | | | [ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35467 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse.rb (OptionParser#to_a): should split by end-of-linenobu2012-04-241-3/+3
| | | | | | | [ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35455 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse.rb (OptionParser#to_a): String#to_a is no longernobu2012-04-241-0/+17
| | | | | | | defined. [ruby-dev:45568][Bug #6348] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35453 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse/ac.rb: autoconf-like options.nobu2012-04-021-0/+63
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@35214 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* * lib/optparse.rb (Regexp): fix incorrect options when casting tonobu2012-01-164-0/+24
| | | | | | | | 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
* * lib/optparse.rb: shell completion support for zsh. based onnobu2010-11-191-0/+22
| | | | | | <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
* * lib/optparse.rb: shell completion support for bash.nobu2010-11-192-1/+45
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@29832 b2dd03c8-39d4-4d8f-98ff-823fe69b080e