use of com.jetbrains.commandInterface.commandLine.psi.CommandLineArgument in project intellij-community by JetBrains.
the class CommandLinePsiImplUtils method findBestHelp.
/**
* Tries to find appropriate help for argument. It can be argument help for positional argument or option help
* for option argument.
*
* @param argument argument to search help for
* @return help for argument or null if not found
*/
@Nullable
static Help findBestHelp(@NotNull final CommandLineArgument argument) {
final Option option = argument.findOptionForOptionArgument();
if (option != null) {
return option.getHelp();
}
final Argument realArgument = argument.findRealArgument();
return (realArgument != null ? realArgument.getHelp() : null);
}
Aggregations