# OptionParser::getopts

**URL:** <https://www.ruby-forum.com/t/optionparser-getopts/70013>\
**Category:** Development\
**Created:** [September 26, 2006, 12:48pm UTC](https://www.ruby-forum.com/t/optionparser-getopts/70013 "2006-09-26T12:48:32Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![WATANABE\_Hirofumi](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/w/f0a364/32.png) [@WATANABE\_Hirofumi](https://www.ruby-forum.com/u/WATANABE_Hirofumi)\
**Post date:** [September 26, 2006, 12:48pm UTC](https://www.ruby-forum.com/t/optionparser-getopts/70013/1 "2006-09-26T12:48:32Z")

</div>

e$B$o$?$J$Y$G$9!#e(B

OptionParser::getoptse$B$NB8:\_$r:#F|=i$a$FCN$C$?$s$G$9$,!"5sF0$,JQ$G$9!#e(B

% ruby-1.8.5 -roptparse -e ‘p OptionParser.getopts(ARGV, “ab”)’ – -a -b  
{“a”=\>false, “b”=\>false, :a=\>true, :b=\>true}

e$B$J$s$Ge(Bfalsee$B$J$s$G$7$g$&!)e(B
