# Optparse. many-characters option with single dash

**URL:** <https://www.ruby-forum.com/t/optparse-many-characters-option-with-single-dash/109246>\
**Category:** Ruby\
**Created:** [July 12, 2007, 6:10pm UTC](https://www.ruby-forum.com/t/optparse-many-characters-option-with-single-dash/109246 "2007-07-12T18:10:41Z")\
**Posts on this page:** 2\
**Page:** 1

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 12, 2007, 6:10pm UTC](https://www.ruby-forum.com/t/optparse-many-characters-option-with-single-dash/109246/1 "2007-07-12T18:10:41Z")

</div>

I looked at getoptlong and optparse and I don’t think any of them allow  
multiple characters with a single dash (-nodisplay, -nosplash, etc). But  
I’m no expert so I might have overlooked it.

Before I try to code this myself, I wonder if it is actually possible  
with optparse or any other existing library to have this many-characters  
option with single dash. Yes, it won’t be POSIX correct, but that’s ok  
for me.

Thanks in advance for your reply.

-andre

---

<div class="post-metadata">

**Author:** ![casper\_the\_ghost](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/c/58956e/32.png) [@casper\_the\_ghost](https://www.ruby-forum.com/u/casper_the_ghost)\
**Post date:** [July 13, 2007, 8:13am UTC](https://www.ruby-forum.com/t/optparse-many-characters-option-with-single-dash/109246/2 "2007-07-13T08:13:13Z")

</div>

Hi,

At Fri, 13 Jul 2007 01:09:31 +0900,  
Andreas S wrote in [ruby-talk:259101]:

> I looked at getoptlong and optparse and I don’t think any of  
> them allow multiple characters with a single dash  
> (-nodisplay, -nosplash, etc). But I’m no expert so I might  
> have overlooked it.
> 
> Before I try to code this myself, I wonder if it is actually  
> possible with optparse or any other existing library to have  
> this many-characters option with single dash. Yes, it won’t  
> be POSIX correct, but that’s ok for me.

getoptlong is based on GNU getoptlong function, and optparse is  
inspired by it too. So, long options with single dash are not  
the target of them.
