-
-
Notifications
You must be signed in to change notification settings - Fork 229
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
commandline: Refactor and streamline special syntaxes
All those special syntaxes only trigger if args.length >= 2, so first we can nest them in a new scope, which also makes it visually more distinct. Additionally, the third and second cases were actually inverted: if the third case was to pass, it means the second case couldn't have passed (because they check present/absence of an extension, respectively), so we can swap them and use an else-if. The result is arguably much more readable, and highlight the fact that if the first case (stdin) is used, the second case will.
- Loading branch information
Showing
1 changed file
with
33 additions
and
18 deletions.
There are no files selected for viewing
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