# Non-destructive option parser?

**URL:** <https://www.ruby-forum.com/t/non-destructive-option-parser/135789>\
**Category:** Ruby\
**Created:** [April 24, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/non-destructive-option-parser/135789 "2008-04-24T23:52:42Z")\
**Posts on this page:** 3\
**Page:** 1

<div class="post-metadata">

**Author:** ![kyle\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Post date:** [April 24, 2008, 11:52pm UTC](https://www.ruby-forum.com/t/non-destructive-option-parser/135789/1 "2008-04-24T23:52:42Z")

</div>

From playing with optionparser today, it appears to be a destructive  
tokenizer, albeit a really cool one. I was just wondering if there is  
some sort of non-destructive versions of it?

Thanks,  
Kyle

---

<div class="post-metadata">

**Author:** ![kyle\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Post date:** [April 25, 2008, 2:11am UTC](https://www.ruby-forum.com/t/non-destructive-option-parser/135789/2 "2008-04-25T02:11:26Z")

</div>

On Thu, 24 Apr 2008 16:51:59 -0500, Kyle S. wrote:

> From playing with optionparser today, it appears to be a destructive  
> tokenizer, albeit a really cool one. I was just wondering if there is  
> some sort of non-destructive versions of it?
> 
> Thanks,  
> Kyle

OptionParser#parse! is destructive, OptionParser#parse is nondestructive

---

<div class="post-metadata">

**Author:** ![kyle\_s](https://www.ruby-forum.com/letter_avatar_proxy/v4/letter/k/f6c823/32.png) [@kyle\_s](https://www.ruby-forum.com/u/kyle_s)\
**Post date:** [April 25, 2008, 4:09pm UTC](https://www.ruby-forum.com/t/non-destructive-option-parser/135789/3 "2008-04-25T16:09:00Z")

</div>

I am so dense sometimes.

Thanks.
