Skip to content

Commit

Permalink
Using switch-case instead of ifs
Browse files Browse the repository at this point in the history
Fixes #5920
  • Loading branch information
ycombinator authored and epixa committed Jan 16, 2016
1 parent ef68493 commit f3df973
Showing 1 changed file with 10 additions and 9 deletions.
19 changes: 10 additions & 9 deletions src/cli/plugin/plugin.js
Original file line number Diff line number Diff line change
Expand Up @@ -19,16 +19,17 @@ export default function pluginCli(program) {

const logger = pluginLogger(settings);

if (settings.action === 'install') {
installer.install(settings, logger);
switch (settings.action) {
case 'install':
installer.install(settings, logger);
break;
case 'remove':
remover.remove(settings, logger);
break;
case 'list':
lister.list(settings, logger);
break;
}
if (settings.action === 'remove') {
remover.remove(settings, logger);
}
if (settings.action === 'list') {
lister.list(settings, logger);
}

}

program
Expand Down

0 comments on commit f3df973

Please sign in to comment.