Remove default values for CLI arguments, all params except -h now required
Co-Authored-By: Claude Opus 4.7 <noreply@anthropic.com>
This commit is contained in:
parent
01505285b0
commit
3877d51560
@ -64,23 +64,21 @@ public class EtsScraper {
|
||||
}
|
||||
}
|
||||
|
||||
if (proxyHost == null) {
|
||||
proxyHost = "http://127.0.0.1:8081";
|
||||
}
|
||||
if (proxyUser == null) {
|
||||
proxyUser = "admin";
|
||||
}
|
||||
if (proxyPass == null) {
|
||||
proxyPass = "123456";
|
||||
if (proxyHost == null || proxyUser == null || proxyPass == null || dateStr == null) {
|
||||
System.err.println("[-] Missing required arguments");
|
||||
printHelp();
|
||||
return;
|
||||
}
|
||||
|
||||
java.time.LocalDate targetDate;
|
||||
if (dateStr != null) {
|
||||
try {
|
||||
targetDate = java.time.LocalDate.parse(dateStr);
|
||||
} else {
|
||||
targetDate = java.time.LocalDate.now().minusDays(1);
|
||||
} catch (Exception e) {
|
||||
System.err.println("[-] Invalid date format: " + dateStr + ", expected yyyy-MM-dd");
|
||||
return;
|
||||
}
|
||||
String dateStrFormatted = targetDate.format(java.time.format.DateTimeFormatter.ofPattern("yyyy-MM-dd"));
|
||||
|
||||
String dateStrFileName = targetDate.format(DateTimeFormatter.ofPattern("yyyyMMdd"));
|
||||
|
||||
try {
|
||||
@ -244,10 +242,10 @@ public class EtsScraper {
|
||||
用法: java -jar ets-playwright.jar [选项]
|
||||
|
||||
选项:
|
||||
-s <url> ets-proxy 服务器地址 (默认: http://127.0.0.1:8081)
|
||||
-u <user> ets-proxy 用户名 (默认: admin)
|
||||
-p <pass> ets-proxy 密码 (默认: 123456)
|
||||
-d <date> 查询日期,格式 yyyy-MM-dd (默认: 昨天)
|
||||
-s <url> ets-proxy 服务器地址
|
||||
-u <user> ets-proxy 用户名
|
||||
-p <pass> ets-proxy 密码
|
||||
-d <date> 查询日期,格式 yyyy-MM-dd
|
||||
-h 显示此帮助信息
|
||||
|
||||
示例:
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user