(&self)
| 55 | |
| 56 | impl IntentUpdate { |
| 57 | fn resolve_body(&self) -> CliResult<Option<String>> { |
| 58 | if let Some(ref body) = self.body { |
| 59 | return Ok(Some(body.clone())); |
| 60 | } |
| 61 | if self.body_stdin { |
| 62 | use std::io::Read; |
| 63 | let mut content = String::new(); |
| 64 | std::io::stdin() |
| 65 | .read_to_string(&mut content) |
| 66 | .map_err(CliError::Io)?; |
| 67 | return Ok(Some(content)); |
| 68 | } |
| 69 | Ok(None) |
| 70 | } |
| 71 | } |
| 72 | |
| 73 | impl Command for IntentUpdate { |