Skip to content

Commit

Permalink
<fix>(jline): fix jline not complete sysconfig bug.
Browse files Browse the repository at this point in the history
  • Loading branch information
kyonRay committed Oct 23, 2024
1 parent 481c9ee commit 0d73564
Showing 1 changed file with 11 additions and 2 deletions.
13 changes: 11 additions & 2 deletions src/main/java/console/command/JlineUtils.java
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,7 @@
import console.command.completer.CurrentPathCompleter;
import console.command.completer.StringsCompleterIgnoreCase;
import console.contract.utils.ContractCompiler;

import java.io.File;
import java.io.IOException;
import java.util.ArrayList;
Expand All @@ -21,6 +22,7 @@
import java.util.List;
import java.util.Optional;
import java.util.Set;

import org.fisco.bcos.sdk.v3.client.Client;
import org.fisco.bcos.sdk.v3.client.protocol.response.BcosGroupInfo;
import org.fisco.bcos.sdk.v3.client.protocol.response.BcosGroupInfoList;
Expand Down Expand Up @@ -197,7 +199,7 @@ private static List<Completer> generateComplters(Client client) {
keys.add(SystemConfigService.AUTH_STATUS);
for (SystemConfigFeature.Features feature : SystemConfigFeature.Features.values()) {
if (client.getChainCompatibilityVersion()
.compareTo(EnumNodeVersion.convertToVersion(feature.enableVersion()))
.compareTo(EnumNodeVersion.convertToVersion(feature.enableVersion()))
>= 0) {
keys.add(feature.toString());
}
Expand All @@ -214,7 +216,14 @@ private static List<Completer> generateComplters(Client client) {
if (group.isPresent() && !group.get().getNodeList().isEmpty()) {
group.get()
.getNodeList()
.forEach(groupNodeInfo -> keys.addAll(groupNodeInfo.getFeatureKeys()));
.forEach(groupNodeInfo -> {
if (groupNodeInfo.getFeatureKeys() != null) {
keys.addAll(groupNodeInfo.getFeatureKeys());
}
if (groupNodeInfo.getSupportConfigs() != null) {
keys.addAll(groupNodeInfo.getSupportConfigs());
}
});
}
} catch (Exception ignored) {
logger.info("Failed to get group info list, skip feature keys.");
Expand Down

0 comments on commit 0d73564

Please sign in to comment.