()
| 166 | } |
| 167 | |
| 168 | private getCommand(): Command { |
| 169 | return new Command("get") |
| 170 | .arguments("<id>") |
| 171 | .description("Get Sends owned by you.") |
| 172 | .option("--output <output>", "Output directory or filename for attachment.") |
| 173 | .option("--text", "Specifies to return the text content of a Send") |
| 174 | .on("--help", () => { |
| 175 | writeLn(""); |
| 176 | writeLn(" Id:"); |
| 177 | writeLn(""); |
| 178 | writeLn(" Search term or Send's globally unique `id`."); |
| 179 | writeLn(""); |
| 180 | writeLn(" If raw output is specified and no output filename or directory is given for"); |
| 181 | writeLn(" an attachment query, the attachment content is written to stdout."); |
| 182 | writeLn(""); |
| 183 | writeLn(" Examples:"); |
| 184 | writeLn(""); |
| 185 | writeLn(" bw send get searchText"); |
| 186 | writeLn(" bw send get id"); |
| 187 | writeLn(" bw send get searchText --text"); |
| 188 | writeLn(" bw send get searchText --file"); |
| 189 | writeLn(" bw send get searchText --file --output ../Photos/photo.jpg"); |
| 190 | writeLn(" bw send get searchText --file --raw"); |
| 191 | writeLn("", true); |
| 192 | }) |
| 193 | .action(async (id: string, options: OptionValues) => { |
| 194 | await this.exitIfLocked(); |
| 195 | const cmd = new SendGetCommand( |
| 196 | this.serviceContainer.sendService, |
| 197 | this.serviceContainer.environmentService, |
| 198 | this.serviceContainer.searchService, |
| 199 | this.serviceContainer.encryptService, |
| 200 | this.serviceContainer.apiService, |
| 201 | this.serviceContainer.accountService, |
| 202 | this.serviceContainer.sendDecryptionService, |
| 203 | ); |
| 204 | const response = await cmd.run(id, options); |
| 205 | this.processResponse(response); |
| 206 | }); |
| 207 | } |
| 208 | |
| 209 | private createCommand(): Command { |
| 210 | return new Command("create") |
no test coverage detected