Skip to content

Commit

Permalink
#5: cli fixes (#74)
Browse files Browse the repository at this point in the history
  • Loading branch information
hohwille authored Oct 9, 2023
1 parent 1b470c4 commit de6a617
Show file tree
Hide file tree
Showing 3 changed files with 7 additions and 5 deletions.
6 changes: 4 additions & 2 deletions cli/src/main/java/com/devonfw/tools/ide/cli/Ide.java
Original file line number Diff line number Diff line change
Expand Up @@ -195,7 +195,7 @@ private boolean apply(CliArgument argument, Commandlet commandlet) {
endOpts = true;
} else {
String arg = currentArgument.get();
this.context.trace("Trying to match argument '{}'", argument);
this.context.trace("Trying to match argument '{}'", currentArgument);
if ((currentProperty != null) && (currentProperty.isExpectValue())) {
currentProperty.setValueAsString(arg);
if (!currentProperty.isMultiValued()) {
Expand Down Expand Up @@ -239,7 +239,9 @@ private boolean apply(CliArgument argument, Commandlet commandlet) {
return false;
}
}
currentProperty = null;
if ((currentProperty != null) && !currentProperty.isMultiValued()) {
currentProperty = null;
}
} else {
this.context.trace("Found option by name");
String value = currentArgument.getValue();
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -98,12 +98,12 @@ private void printCommandletHelp(NlsBundle bundle, Commandlet cmd) {
}
String name = property.getName();
if (name.isEmpty()) {
assert (property instanceof KeywordProperty);
assert !(property instanceof KeywordProperty);
String key = "<" + property.getAlias() + ">";
usage.append(key);
values.add(key, bundle.get(cmd, property));
} else {
assert !(property instanceof KeywordProperty);
assert (property instanceof KeywordProperty);
usage.append(name);
}
if (property.isMultiValued()) {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -93,7 +93,7 @@ public boolean isRequired() {
*/
public boolean isExpectValue() {

return !"".equals(this.name);
return "".equals(this.name);
}

/**
Expand Down

0 comments on commit de6a617

Please sign in to comment.