io.quarkiverse.githubapp.command.airline.AbstractHelpCommand Maven / Gradle / Ivy
Go to download
Show more of this group Show more artifacts with this name
Show all versions of quarkus-github-app-command-airline Show documentation
Show all versions of quarkus-github-app-command-airline Show documentation
Add comment-based commands to your GitHub App
package io.quarkiverse.githubapp.command.airline;
import java.io.ByteArrayOutputStream;
import java.io.IOException;
import java.nio.charset.StandardCharsets;
import java.util.ArrayList;
import java.util.List;
import org.kohsuke.github.GHEventPayload;
import com.github.rvesse.airline.annotations.Arguments;
import com.github.rvesse.airline.help.Help;
import com.github.rvesse.airline.model.GlobalMetadata;
public class AbstractHelpCommand {
@AirlineInject
public GlobalMetadata> global;
@Arguments
public List command = new ArrayList<>();
public void run(GHEventPayload.IssueComment issueCommentPayload) throws IOException {
try {
ByteArrayOutputStream helpOs = new ByteArrayOutputStream();
Help.help(global, command, helpOs);
issueCommentPayload.getIssue().comment("```\n" + helpOs.toString(StandardCharsets.UTF_8).trim() + "\n```");
} catch (IOException e) {
throw new RuntimeException("Error generating usage documentation for " + String.join(" ", command), e);
}
}
}
© 2015 - 2025 Weber Informatics LLC | Privacy Policy