Removing dependency on args being in alphabetical order. #507
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.
Previously, the arg parser would display the arguments in the help section in alphabetical order. If you run
jscodeshift -h
you've notice all the arguments are displayed in alphabetical order. The algorithm that prints out the help page actually relies on them being in alphabetical order. The problem with this approach is that if there's a command that should be included in a category of arguments that appears in the middle of the page, but the new argument starts with a "z", then the new argument will appear in the last lines on the help page, and not in the middle where it's supposed to be.Since we're need to move in the direction of grouping arguments by functionality independent of names (like for upcoming --gitignore flag), we now have to come up with a quick refactoring that allows arguments to be displayed in a specified order regardless of what alphabetical order the arguments themselves occupy.