Skip to content

Commit

Permalink
git-pr reviewer rename add option to credit
Browse files Browse the repository at this point in the history
  • Loading branch information
amCap1712 committed Nov 2, 2020
1 parent d240127 commit e6dfcc8
Showing 1 changed file with 5 additions and 7 deletions.
12 changes: 5 additions & 7 deletions cli/src/main/java/org/openjdk/skara/cli/pr/GitPrReviewer.java
Expand Up @@ -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.*;

Expand All @@ -34,7 +32,7 @@
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")
.optional(),
Expand Down Expand Up @@ -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);
}
}
Expand Down

0 comments on commit e6dfcc8

Please sign in to comment.