(c *cli.Context)
| 155 | } |
| 156 | |
| 157 | func validateCatCommand(c *cli.Context) error { |
| 158 | if c.Args().Len() != 1 { |
| 159 | return fmt.Errorf("expected only one argument") |
| 160 | } |
| 161 | |
| 162 | src, err := url.New(c.Args().Get(0), url.WithVersion(c.String("version-id")), |
| 163 | url.WithRaw(c.Bool("raw"))) |
| 164 | if err != nil { |
| 165 | return err |
| 166 | } |
| 167 | |
| 168 | if !src.IsRemote() { |
| 169 | return fmt.Errorf("source must be a remote object") |
| 170 | } |
| 171 | |
| 172 | if err := checkVersioningWithGoogleEndpoint(c); err != nil { |
| 173 | return err |
| 174 | } |
| 175 | |
| 176 | if src.IsWildcard() || src.IsPrefix() || src.IsBucket() { |
| 177 | if c.String("version-id") != "" { |
| 178 | return fmt.Errorf("wildcard/prefix operations are disabled with --version-id flag") |
| 179 | } |
| 180 | } |
| 181 | |
| 182 | return nil |
| 183 | } |
no test coverage detected