func buildRequestFromFlags(requester string) (request.Request, error) {
	var reviewers []string
	if len(*requestReviewers) > 0 {
		for _, reviewer := range strings.Split(*requestReviewers, ",") {
			reviewers = append(reviewers, strings.TrimSpace(reviewer))
		}
	}
	if *requestMessageFile != "" && *requestMessage == "" {
		var err error
		*requestMessage, err = input.FromFile(*requestMessageFile)
		if err != nil {
			return request.Request{}, err
		}
	}
	return request.New(requester, reviewers, *requestSource, *requestTarget, *requestMessage), nil
}
Build the template review request based solely on the parsed flag values.
package commands
import (
	"errors"
	"flag"
	"fmt"
	"strings"
	"github.com/google/git-appraise/commands/input"
	"github.com/google/git-appraise/repository"
	"github.com/google/git-appraise/review/gpg"
	"github.com/google/git-appraise/review/request"
)
const requestSummaryTemplate = `Review requested:
Commit: %s
Target Ref: %s
Review Ref: %s
Message: "%s"
`
var requestFlagSet = flag.NewFlagSet("request", flag.ExitOnError)
var (
	requestMessageFile      = requestFlagSet.String("F", "", "Take the comment from the given file. Use - to read the message from the standard input")
	requestMessage          = requestFlagSet.String("m", "", "Message to attach to the review")
	requestReviewers        = requestFlagSet.String("r", "", "Comma-separated list of reviewers")
	requestSource           = requestFlagSet.String("source", "HEAD", "Revision to review")
	requestTarget           = requestFlagSet.String("target", "refs/heads/master", "Revision against which to review")
	requestQuiet            = requestFlagSet.Bool("quiet", false, "Suppress review summary output")
	requestAllowUncommitted = requestFlagSet.Bool("allow-uncommitted", false, "Allow uncommitted local changes.")
	requestSign             = requestFlagSet.Bool("S", false,
		"GPG sign the content of the request")
)