# Optparse, needless argument, mac os x intel

**URL:** <https://www.ruby-forum.com/t/optparse-needless-argument-mac-os-x-intel/88508>\
**Category:** Ruby\
**Created:** [March 12, 2007, 6:46am UTC](https://www.ruby-forum.com/t/optparse-needless-argument-mac-os-x-intel/88508 "2007-03-12T06:46:46Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [March 12, 2007, 6:46am UTC](https://www.ruby-forum.com/t/optparse-needless-argument-mac-os-x-intel/88508/1 "2007-03-12T06:46:46Z")

</div>

I’ve just started using optparse. I’m hitting this needless argument  
error when one of my commandline args excepts strings… I’ve looked  
around on google seeing that this was a bug that was fixed at some  
point. How can I get around it?

thanks…

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [March 12, 2007, 7:28am UTC](https://www.ruby-forum.com/t/optparse-needless-argument-mac-os-x-intel/88508/2 "2007-03-12T07:28:44Z")

</div>

On Mon, 12 Mar 2007, Aaron S. wrote:

> I’ve just started using optparse. I’m hitting this needless argument  
> error when one of my commandline args excepts strings… I’ve looked  
> around on google seeing that this was a bug that was fixed at some  
> point. How can I get around it?

it means that you defined are argument like this

‘–foo’

but are giving it like this on command line

a.rb --foo=value

if you want an option to take values use

‘–foo=value’  
‘–foo=this\_can\_be\_anyword’

regards.

-a

---

<div class="post-metadata">

**Author:** ![ktheory](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/e480ec/32.png) [@ktheory](https://www.ruby-forum.com/u/ktheory)\
**Post date:** [March 12, 2007, 7:39am UTC](https://www.ruby-forum.com/t/optparse-needless-argument-mac-os-x-intel/88508/3 "2007-03-12T07:39:32Z")

</div>

a.rb --foo=value

> if you want an option to take values use
> 
> ‘–foo=value’  
> ‘–foo=this\_can\_be\_anyword’
> 
> regards.
> 
> -a

cool thanks.  
-a
