Open
Conversation
Codecov Report
@@ Coverage Diff @@
## master #22 +/- ##
============================================
+ Coverage 81.79% 82.82% +1.02%
- Complexity 137 143 +6
============================================
Files 11 12 +1
Lines 357 390 +33
Branches 72 73 +1
============================================
+ Hits 292 323 +31
- Misses 30 32 +2
Partials 35 35
Continue to review full report at Codecov.
|
xenomachina
requested changes
Sep 30, 2017
Owner
xenomachina
left a comment
There was a problem hiding this comment.
Sorry it took so long for me to review this. I was swamped with other stuff.
Overall, this looks great! Thank you for this contribution. I only have a few minor suggestions.
| class ShowAutoCompletionException internal constructor( | ||
| private val autoCompletion: AutoCompletion, | ||
| private val delegates: List<ArgParser.Delegate<*>> | ||
| ) : SystemExitException("Help was requested", 0) { |
| @@ -0,0 +1,49 @@ | |||
| // Copyright © 2016 Laurence Gonsalves | |||
Owner
There was a problem hiding this comment.
This should be 2017 and your name.
| class DefaultAutoCompletion : AutoCompletion { | ||
| override fun format(progName: String?, delegates: List<ArgParser.Delegate<*>>): String { | ||
| val sb = StringBuilder() | ||
| sb.append("_$progName()\n") |
Owner
There was a problem hiding this comment.
Perhaps triple-quoted strings would make this a bit easier to read?
This file contains hidden or 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
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.
Fix #9
Implement basic functionallity for generating bash/zsh autocompletion script.
Note: The implementation of Delegate:toAutoCompletion is maybe not the best way to do this. But I needed a way to access the optionNames.