Skip to content

Commit

Permalink
fixing bug on setting directory containing hyphen.
Browse files Browse the repository at this point in the history
  • Loading branch information
emarx committed Sep 7, 2016
1 parent 4cb6b7b commit 7b3da39
Showing 1 changed file with 5 additions and 3 deletions.
8 changes: 5 additions & 3 deletions kbox.kibe/src/main/java/org/aksw/kbox/kibe/KBox.java
Original file line number Diff line number Diff line change
Expand Up @@ -144,7 +144,8 @@ public static void main(String[] args) throws Exception {
removeKNS(new URL(knsURL));
logger.info("KNS removed.");
} else if (commands.containsKey(RESOURCE_DIR_COMMAND)) {
String resourceDir = commands.get(RESOURCE_DIR_COMMAND);
String resourceDir = commands.get(RESOURCE_DIR_COMMAND);
logger.info(resourceDir);
if(resourceDir != null) {
try {
setResourceFolder(resourceDir);
Expand Down Expand Up @@ -227,14 +228,15 @@ public static void removeKNS(URL url) {

/**
* Command line parser.
*
* @param args a set o arguments received by command line
* @return a Map containing the parsed arguments
*/
public static Map<String, String> parse(String[] args) {
Map<String, String> map = new HashMap<String, String>();
for(int i = 0; i < args.length ; i++) {
if(args[i].contains("-")) { // is a command
if(i+1 < args.length && !args[i+1].contains("-")) {
if(args[i].startsWith("-")) { // is a command
if(i+1 < args.length && !args[i+1].startsWith("-")) {
map.put(args[i], args[i+1]);
} else {
map.put(args[i], null);
Expand Down

0 comments on commit 7b3da39

Please sign in to comment.