-
Notifications
You must be signed in to change notification settings - Fork 102
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Add autocomplete toggle #211
Merged
davetron5000
merged 11 commits into
davetron5000:gli-2
from
chrisarcand:add-autocorrect-toggle
Mar 3, 2015
Merged
Add autocomplete toggle #211
davetron5000
merged 11 commits into
davetron5000:gli-2
from
chrisarcand:add-autocorrect-toggle
Mar 3, 2015
Conversation
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Methods and options are cleaner. The options allow flexibility for adding features, such as the one I'm adding in this pull request (enable/disable autocorrect on partial commands)
Delegate some work to a helper method; also I think commands_with_aliases is a bit more helpful to read, the intent wasn't really coming to me quickly when I first read it.
This allows for easier passing of things without constantly changing the method signature
chrisarcand
force-pushed
the
add-autocorrect-toggle
branch
from
February 27, 2015 14:05
f1d4b4a
to
4425b19
Compare
Ah, yeah good idea on this feature. Briefly skimming, this looks good, but I'll give it a more thorough look this weekend. |
Thanks for this. I wrapped the warning |
Sweet 👍 Thanks Dave! |
This is up as 2.13.0 and the online RDoc should be updated. Thanks again! |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Adds an option to the DSL for enabling/disabling the simple autocomplete feature in
CommandFinder
:Full doc:
If you're curious, the desire to have this feature comes from sportngin/octopolo#34
We have a
deployable
command in one of our CLI gems anddeploy
in another - and people (more than once) have accidentally marked their feature branches for merging when they intended a deployment :)Other small tidbits:
CommandFinder
andGLIOptionParser
to use options hashes in their method signatures. This allows for much greater flexibility in doing something such as this autocomplete feature without constantly just pushing more and more parameters into the method signatures.CommandFinder
written before I refactored the class a bit. Things are reordered and pushed around but the functionality (beyond the toggle) should be the same.The tests all pass, but do let me know if you see anything fishy that I missed. Thanks Dave!