Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SKARA-725: Rename git-pr-reviewer --add to git-pr-reviewer --credit #938

Closed
wants to merge 2 commits into from
Closed
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
@@ -23,8 +23,6 @@
package org.openjdk.skara.cli.pr;

import org.openjdk.skara.args.*;
import org.openjdk.skara.issuetracker.Comment;
import org.openjdk.skara.forge.PullRequest;

import static org.openjdk.skara.cli.pr.Utils.*;

@@ -34,9 +32,9 @@
public class GitPrReviewer {
static final List<Flag> flags = List.of(
Option.shortcut("")
.fullname("add")
.fullname("credit")
.describe("USERNAME")
.helptext("Consider pull request reviewed by this user")
.helptext("Credit a person as a reviewer of this pull request")
.optional(),
Option.shortcut("")
.fullname("remove")
@@ -73,16 +71,16 @@ public static void main(String[] args) throws IOException, InterruptedException
var id = pullRequestIdArgument(repo, arguments);
var pr = getPullRequest(uri, repo, host, id);

if (arguments.contains("add")) {
var username = arguments.get("add").asString();
var comment = pr.addComment("/reviewer add" + " " + username);
if (arguments.contains("credit")) {
var username = arguments.get("credit").asString();
var comment = pr.addComment("/reviewer credit" + " " + username);
showReply(awaitReplyTo(pr, comment));
} else if (arguments.contains("remove")) {
var username = arguments.get("remove").asString();
var comment = pr.addComment("/reviewer remove" + " " + username);
showReply(awaitReplyTo(pr, comment));
} else {
System.err.println("error: must use either --add or --remove");
System.err.println("error: must use either --credit or --remove");
System.exit(1);
}
}