るりまサーチ (Ruby 3.2)

最速Rubyリファレンスマニュアル検索!
1件ヒット [1-1件を表示] (0.073秒)
トップページ > クエリ:|[x] > クエリ:-[x] > クエリ:path[x] > バージョン:3.2[x] > クラス:OptionParser[x]

別のキーワード

  1. _builtin |
  2. set |
  3. ipaddr |
  4. array |
  5. integer |

ライブラリ

検索結果

OptionParser#program_name -> String (358.0)

プログラムの名前を文字列で返します。

...字列で返します。

デフォルトは $0 が使われます。

@return プログラムの名前を文字列で返します。

//emlist[例][ruby]{
require "optparse"

OptionParser
.new do |opts|
p $0 # => /path/to/filename.rb
p opts.program_name # => filename
end
//}...