aboutsummaryrefslogtreecommitdiffstats
path: root/lib/optparse.rb
Commit message (Collapse)AuthorAgeFilesLines
* [ruby/optparse] Bump up 0.4.0Hiroshi SHIBATA2023-11-071-1/+1
| | | | https://github.com/ruby/optparse/commit/acbf6e3e12
* [ruby/optparse] [DOC] Mark up constant and method names as codeNobuyoshi Nakada2023-07-301-1/+1
| | | | https://github.com/ruby/optparse/commit/e8bee0be8f
* [ruby/optparse] Document requires needed for ↵Jeremy Evans2023-04-041-6/+6
| | | | | | | | Date/DateTime/Time/URI/Shellwords support Fixes [Bug #19566] https://github.com/ruby/optparse/commit/fb91d97c10
* [ruby/optparse] Add symbolize_names to getoptsJunichi Ito2022-12-261-6/+15
| | | | https://github.com/ruby/optparse/commit/3e63d878f8
* [ruby/optparse] bump up to 0.4.0.pre.1Nobuyoshi Nakada2022-12-261-1/+1
| | | | https://github.com/ruby/optparse/commit/73661899ad
* [ruby/optparse] Bump version to 0.3.1Hiroshi SHIBATA2022-12-221-1/+1
| | | | https://github.com/ruby/optparse/commit/2a1e157ae1
* [ruby/optparse] The encoding argument of `Regexp.new` has been ignored since 1.9Nobuyoshi Nakada2022-12-211-3/+16
| | | | https://github.com/ruby/optparse/commit/766f567405
* [ruby/optparse] Bump version to 0.3.0Hiroshi SHIBATA2022-12-051-1/+1
| | | | https://github.com/ruby/optparse/commit/c80dfb1ebd
* [ruby/optparse] Add `raise_unknown` flagNobuyoshi Nakada2022-11-281-0/+7
| | | | | | (https://github.com/ruby/optparse/pull/38) https://github.com/ruby/optparse/commit/12529653cd
* [ruby/optparse] Use class methods of `File` over `IO`Nobuyoshi Nakada2022-11-211-1/+1
| | | | https://github.com/ruby/optparse/commit/ab5073e4d8
* [ruby/optparse] #load() into hashWhyme Lyu2022-10-291-4/+7
| | | | | | | | | (https://github.com/ruby/optparse/pull/42) OptionParser#load learns .load(into: Hash) https://github.com/ruby/optparse/commit/2ea626fcff Co-authored-by: Nobuyoshi Nakada <nobu@ruby-lang.org>
* [ruby/optparse] Don't treat empty string as an option descriptionMaciek Rząsa2022-10-081-1/+1
| | | | https://github.com/ruby/optparse/commit/078638ee6d
* [ruby/optparse] Also accept '-' as an optional argument ↵konsolebox2022-07-291-3/+3
| | | | | | (https://github.com/ruby/optparse/pull/35) https://github.com/ruby/optparse/commit/f2b8318631
* [ruby/optparse] Define `inspect` and `pretty_inspect`Nobuyoshi Nakada2022-04-041-0/+73
| | | | https://github.com/ruby/optparse/commit/a3f0ec21b1
* [ruby/optparse] Fix links to the page directory files [Bug #18468]Nobuyoshi Nakada2022-01-121-2/+2
| | | | https://github.com/ruby/optparse/commit/dab72c543d
* [ruby/optparse] Bump up optparse version to 0.2.0Hiroshi SHIBATA2021-10-211-1/+1
| | | | https://github.com/ruby/optparse/commit/1226b670e6
* [ruby/optparse] More on tutorial (https://github.com/ruby/optparse/pull/23)Burdette Lamar2021-07-281-2/+8
| | | | | | | | - Removed a largish block of repeated text. - Added sections "Top List and Base List" and "Methods for Defining Options" (on, define, etc.). - Linked from class OptionParser doc to the tutorial. https://github.com/ruby/optparse/commit/7f3195b9db
* [ruby/optparse] nodoc private methodsNobuyoshi Nakada2021-07-281-7/+7
| | | | https://github.com/ruby/optparse/commit/f23d750d14
* [ruby/optparse] Moved rdoc files to doc/optparseNobuyoshi Nakada2021-04-111-7/+7
| | | | https://github.com/ruby/optparse/commit/cccb28e0de
* [ruby/optparse] Make use of option_params.rdocBurdetteLamar2021-04-081-65/+17
| | | | https://github.com/ruby/optparse/commit/d55d9284c3
* [ruby/optparse] bump up to 0.1.1Nobuyoshi Nakada2021-03-291-1/+1
| | | | https://github.com/ruby/optparse/commit/2fe984a603
* [ruby/optparse] Fixed error message of unparsed non-optionNobuyoshi Nakada2021-03-291-0/+5
| | | | | | Close https://github.com/ruby/optparse/issues/3 https://github.com/ruby/optparse/commit/94c5cf4032
* [ruby/optparse] Change *opts to *params, to avoid confusionBurdetteLamar2021-03-291-13/+32
| | | | https://github.com/ruby/optparse/commit/f5f5e202dd
* [ruby/optparse] Add OptionParser#require_exact accessorJeremy Evans2021-03-291-0/+9
| | | | | | | | | 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
* Separate `send` into `public_send` and `__send__`Nobuyoshi Nakada2020-10-271-1/+1
|
* [ruby/optparse] Define OptionParser::VersionNobuyoshi Nakada2020-07-231-0/+2
| | | | https://github.com/ruby/optparse/commit/4c0021b5b2
* Revert "Method reference operator"Nobuyoshi Nakada2019-11-121-1/+1
| | | | | This reverts commit 67c574736912003c377218153f9d3b9c0c96a17b. [Feature #16275]
* OptionParser: document into: argumentzverok2019-10-261-3/+12
|
* Make suggestions order stable [Bug #16263]Nobuyoshi Nakada2019-10-211-1/+1
| | | | | As the result order of `DidYouMean::SpellChecker#correct` is undefined, keep the order of the original candidates.
* Support DidYouMean by AmbiguousOption tooNobuyoshi Nakada2019-10-181-2/+3
|
* Defer adding additional info until getting the message of an errorNobuyoshi Nakada2019-10-181-13/+20
|
* Use DidYouMean.formatterNobuyoshi Nakada2019-10-181-1/+1
| | | | Instead of building messages separately.
* lib/optparse.rb: Show a did_you_mean hint for unknown optionYusuke Endoh2019-10-181-2/+16
| | | | | | | | | | | | | | | | | | | | ``` 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 ```
* Fix default argument values for OptParse::Switch#summarizeJeremy Evans2019-07-071-1/+1
| | | | | | | | | | The documentation describes these arguments being hashes, and the method is called with hashes, so a hash default makes more sense. The method would fail previously if called without arguments and @short or @long contained a non-integer value. Fixes [Bug #10928]
* Load OptionParser defaults from XDG and Haiku standardsNobuyoshi Nakada2019-05-061-5/+18
|
* Use delete_prefix instead of `sub(/\Afixed-pattern/, '')`kazu2018-12-041-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66189 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optarse.rb: mention multiple descriptions [ci skip]nobu2018-12-021-0/+2
| | | | | | [ruby-list:50718] git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66134 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Get rid of block-less Proc.newnobu2018-11-281-1/+2
| | | | | | | * lib/optparse.rb (OptionParser::Switch#initialize): get rid of `Proc.new` without a block, which may be deprecated in the future. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66069 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* Remove useless backslashnobu2018-11-281-1/+1
| | | | | | | * lib/optparse.rb (OptionParser::Switch#compsys): remove useless backslash which just confuse ruby-mode.el. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@66068 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* lib/optparse.rb: improve docsstomar2018-05-161-14/+17
| | | | | | | * lib/optparse.rb: [DOC] simplify shell prompt in examples; other minor improvements. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63445 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: Remove redundant `.freeze`nobu2018-05-131-8/+8
| | | | | | | | [Fix GH-1873] From: Masataka Pocke Kuwabara <kuwabara@pocke.me> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63411 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: [DOC] about into: optionnobu2018-05-121-0/+23
| | | | | | | | | | * lib/optparse.rb: add documentation for "into" option of #parse and family, which stores options to a Hash. [ruby-core:87004] [Misc #14753] From: pocke (Masataka Kuwabara) <kuwabara@pocke.me> git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@63410 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse: Suppress warningsnobu2018-05-061-2/+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-4/+4
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62047 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: literal newlinenobu2018-01-251-1/+2
| | | | | | | | * lib/optparse.rb (OptionParser#summarize): use literal newline to join option summaries as IO#puts does, not the special gloval variable $/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62035 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* revert r62032 because it refers to a undefined variableko12018-01-251-1/+1
| | | | git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62034 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: literal newlinenobu2018-01-241-1/+1
| | | | | | | | * lib/optparse.rb (OptionParser#summarize): use literal newline to join option summaries as IO#puts does, not the special gloval variable $/. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@62032 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: case-sensitive candidatenobu2017-07-241-4/+4
| | | | | | | | * 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: [DOC] fix keysnobu2017-07-211-5/+5
| | | | | | | * lib/optparse.rb (getopts): [DOC] parameter keys are strings, not symbols. git-svn-id: svn+ssh://ci.ruby-lang.org/ruby/trunk@59383 b2dd03c8-39d4-4d8f-98ff-823fe69b080e
* optparse.rb: get rid of evalnobu2017-07-121-7/+13
| | | | | | | * 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