Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

Already on GitHub? Sign in to your account

Simplify Options parser #271

Closed
wants to merge 1 commit into
from

Conversation

Projects
None yet
1 participant
Contributor

sol commented Nov 1, 2012

If current looks like a switch, but is not a "registered switch", or if
it is a regular argument, we shift until we see something that starts
with a dash.

@sol sol Simplify Options parser
If current looks like a switch, but is not a "registered switch", or if
it is a regular argument, we shift until we see something that starts
with a dash.
e98a208
Contributor

sol commented Nov 2, 2012

We had separate code branches for "current is an unknown option" and "current is a regular argument". But the net effect of both code branches was the same:

shift until we see something that starts with a dash

I simplified this. It should still have the exact same behavior. It's just simpler and more efficient now (not that I care about efficient here, but anyway).

The main motivation for this is that I want to create a patch on top of this to better support things like bundlers exec command (see carlhuda/bundler#2102), and that would get messy without this simplification.

Contributor

sol commented Nov 3, 2012

I managed to do my change without relying on this refactoring. The simplification could still be useful, but it is currently not critical for me. So I'll close this.

I instead improved the documentation, so that the code is easier to understand (see #274).

@sol sol closed this Nov 3, 2012

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment