(c *cli.Context)
| 105 | } |
| 106 | |
| 107 | func validatePresignCommand(c *cli.Context) error { |
| 108 | if c.Args().Len() != 1 { |
| 109 | return fmt.Errorf("expected remote object url") |
| 110 | } |
| 111 | |
| 112 | src, err := url.New(c.Args().Get(0), url.WithVersion(c.String("version-id"))) |
| 113 | if err != nil { |
| 114 | return err |
| 115 | } |
| 116 | |
| 117 | if !src.IsRemote() { |
| 118 | return fmt.Errorf("source must be a remote object") |
| 119 | } |
| 120 | |
| 121 | if src.IsBucket() || src.IsPrefix() { |
| 122 | return fmt.Errorf("remote source must be an object") |
| 123 | } |
| 124 | |
| 125 | if src.IsWildcard() { |
| 126 | return fmt.Errorf("remote source %q can not contain glob characters", src) |
| 127 | } |
| 128 | |
| 129 | if err := checkVersioningWithGoogleEndpoint(c); err != nil { |
| 130 | return err |
| 131 | } |
| 132 | |
| 133 | return nil |
| 134 | } |
no test coverage detected