Skip to content

Commit

Permalink
修复提示checkArgs一个重构的一些Bug与提示
Browse files Browse the repository at this point in the history
  • Loading branch information
1-6 authored and 1-6 committed Dec 5, 2024
1 parent a49fd0f commit aed3bd0
Showing 1 changed file with 3 additions and 2 deletions.
Original file line number Diff line number Diff line change
Expand Up @@ -4,6 +4,7 @@
import com.lingoutil.workcopilot.scanner.CommandHandlerScanner;
import com.lingoutil.workcopilot.util.LogUtil;

import java.util.Arrays;
import java.util.List;
import java.util.concurrent.ConcurrentHashMap;
import java.util.function.Consumer;
Expand Down Expand Up @@ -65,8 +66,8 @@ protected final boolean checkArgs(String[] argv, int expectedNum, Consumer<Strin

protected final boolean checkArgs(String[] argv, Consumer<String[]> errorHandler, int... expectedNums) {
int length = argv.length;
if (containInArray(expectedNums,length)) {
LogUtil.error("expected argument num is %d, but got %d", expectedNums, length);
if (!containInArray(expectedNums,length)) {
LogUtil.error("expected argument num is %s, but got %d", Arrays.toString(expectedNums), length);
errorHandler.accept(argv);
return false;
}
Expand Down

0 comments on commit aed3bd0

Please sign in to comment.