Skip to content

Commit

Permalink
[fix]去掉命令尾部的URL链接,如果有的话。
Browse files Browse the repository at this point in the history
  • Loading branch information
yajuhua committed Sep 16, 2024
1 parent a378f7e commit 62b1402
Showing 1 changed file with 9 additions and 0 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
import java.lang.reflect.ParameterizedType;
import java.lang.reflect.Type;
import java.net.InetSocketAddress;
import java.net.MalformedURLException;
import java.net.Proxy;
import java.net.URL;
import java.util.*;
Expand Down Expand Up @@ -73,6 +74,14 @@ public static CommandInfo parse(String[] args) throws Exception {
removeOptionFromArgs(argList,optionName,field);
}
}

//去掉命令尾部的URL链接,如果有的话
try {
new URL(argList.get(argList.size() - 1));
argList.remove(argList.size() - 1);//去掉尾部链接
} catch (MalformedURLException ignored) {

}
return commandInfo;
}

Expand Down

0 comments on commit 62b1402

Please sign in to comment.