MCPcopy Create free account
hub / github.com/alibaba/open-code-review / validateDelegateOptions

Function validateDelegateOptions

cmd/opencodereview/shared_flags.go:200–209  ·  view source on GitHub ↗
(opts *delegateOptions)

Source from the content-addressed store, hash-verified

198}
199
200func validateDelegateOptions(opts *delegateOptions) error {
201 opts.to = normalizeDiffTarget(opts.from, opts.to, opts.commit)
202 if err := validateDiffMode(opts.from, opts.to, opts.commit); err != nil {
203 return err
204 }
205 if opts.format != "text" && opts.format != "json" {
206 return fmt.Errorf("invalid --format value %q: must be 'text' or 'json'", opts.format)
207 }
208 return nil
209}
210
211// registerReviewFlags registers all review command flags on cmd, binding to opts.
212func registerReviewFlags(cmd *cobra.Command, opts *reviewOptions) {

Callers 3

delegate_cmd.goFile · 0.85
TestDelegateDiffModesFunction · 0.85

Calls 2

normalizeDiffTargetFunction · 0.85
validateDiffModeFunction · 0.85

Tested by 2

TestDelegateDiffModesFunction · 0.68