Created
October 24, 2017 06:40
-
-
Save DenisZm/6c975ba1d838bd61b9dae689858bdddc to your computer and use it in GitHub Desktop.
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
private static Parameters parseParameters(String[] args) { | |
Parameters parameters = new Parameters(); | |
if (args.length < 2) { | |
return parameters; | |
} | |
for (int i = 0; i < args.length; i++) { | |
if ("--sortByItem".equals(args[i])) { | |
parameters.setSortByItem(); | |
} | |
if ((i + 1) < args.length) { | |
switch (args[i]) { | |
case "-p": | |
parameters.setPrintParameter(args[++i]); | |
break; | |
case "-fgenre": | |
parameters.setGenre(args[++i]); | |
break; | |
case "-f": | |
parameters.setLogin(args[++i]); | |
} | |
} | |
} | |
return parameters; | |
} |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment