(opts *DownloadOptions)
| 115 | } |
| 116 | |
| 117 | func checkArchiveTypeOption(opts *DownloadOptions) error { |
| 118 | if len(opts.ArchiveType) == 0 { |
| 119 | return nil |
| 120 | } |
| 121 | |
| 122 | if err := cmdutil.MutuallyExclusive( |
| 123 | "specify only one of '--pattern' or '--archive'", |
| 124 | true, // ArchiveType len > 0 |
| 125 | len(opts.FilePatterns) > 0, |
| 126 | ); err != nil { |
| 127 | return err |
| 128 | } |
| 129 | |
| 130 | if opts.ArchiveType != "zip" && opts.ArchiveType != "tar.gz" { |
| 131 | return cmdutil.FlagErrorf("the value for `--archive` must be one of \"zip\" or \"tar.gz\"") |
| 132 | } |
| 133 | return nil |
| 134 | } |
| 135 | |
| 136 | func downloadRun(opts *DownloadOptions) error { |
| 137 | httpClient, err := opts.HttpClient() |
no test coverage detected