MCPcopy Index your code
hub / github.com/peak/s5cmd / validateSelectCommand

Function validateSelectCommand

command/select.go:405–438  ·  view source on GitHub ↗
(c *cli.Context)

Source from the content-addressed store, hash-verified

403}
404
405func validateSelectCommand(c *cli.Context) error {
406 if c.Args().Len() != 1 {
407 return fmt.Errorf("expected source argument")
408 }
409
410 if err := checkVersioningFlagCompatibility(c); err != nil {
411 return err
412 }
413
414 if err := checkVersioningWithGoogleEndpoint(c); err != nil {
415 return err
416 }
417
418 srcurl, err := url.New(
419 c.Args().Get(0),
420 url.WithVersion(c.String("version-id")),
421 url.WithRaw(c.Bool("raw")),
422 url.WithAllVersions(c.Bool("all-versions")),
423 )
424
425 if err != nil {
426 return err
427 }
428
429 if !srcurl.IsRemote() {
430 return fmt.Errorf("source must be remote")
431 }
432
433 if c.String("query") == "" {
434 return fmt.Errorf("query must be non-empty")
435 }
436
437 return nil
438}

Callers 1

beforeFuncFunction · 0.85

Calls 9

NewFunction · 0.92
WithVersionFunction · 0.92
WithRawFunction · 0.92
WithAllVersionsFunction · 0.92
IsRemoteMethod · 0.80
GetMethod · 0.45
StringMethod · 0.45

Tested by

no test coverage detected