Open
Description
parseOptionValue(String[] paramNames) -> String => null {
let index = commands.firstNonNull<Int>((command, i) => {
if (paramNames.any({ command.equalsIgnoreCase(_) }) && i == commands.count - 1) {
throw new InvalidCliArgumentException("Invalid #command value")
}
if (i > 0 && paramNames.any({ commands[i - 1].equalsIgnoreCase(_) })) {
return i
}
})
if (index) {
return this.commands.removeAtIndex(index.value - 1, 2).last
}
}
return this.commands.removeAtIndex(index.value - 1, 2).last
should be able to be written as
return this.commands.removeAtIndex(index - 1, 2).last
Metadata
Metadata
Assignees
Type
Projects
Status
No status