(&self)
| 204 | |
| 205 | impl Command for IntentNew { |
| 206 | fn run(&self) -> CliResult<()> { |
| 207 | if self.template != "feature" { |
| 208 | return Err(CliError::InvalidArgument { |
| 209 | message: format!( |
| 210 | "unknown template '{}' (only 'feature' is implemented)", |
| 211 | self.template |
| 212 | ), |
| 213 | }); |
| 214 | } |
| 215 | |
| 216 | let root = find_repository_root()?; |
| 217 | let repo = Repository::open(&root).map_err(CliError::Repository)?; |
| 218 | |
| 219 | let (created, kind) = |
| 220 | create_intent(&repo, &self.title, &self.kind, self.review.as_deref())?; |
| 221 | |
| 222 | println!("Created intent: {}", created.id); |
| 223 | println!(" file: .vault/{}", created.intent_file); |
| 224 | println!(" template: {}", self.template); |
| 225 | println!(" kind: {kind}"); |
| 226 | if let Some(target) = &self.review { |
| 227 | println!(" reviews: {target}"); |
| 228 | } |
| 229 | println!(); |
| 230 | println!("Edit the directive stubs, then:"); |
| 231 | println!(" atomic intent validate {}", created.id); |
| 232 | println!(" atomic intent attest {}", created.id); |
| 233 | |
| 234 | Ok(()) |
| 235 | } |
| 236 | } |
| 237 | |
| 238 | #[cfg(test)] |
nothing calls this directly
no test coverage detected