(&self)
| 141 | |
| 142 | impl Command for IntentNew { |
| 143 | fn run(&self) -> CliResult<()> { |
| 144 | if self.template != "feature" { |
| 145 | return Err(CliError::InvalidArgument { |
| 146 | message: format!( |
| 147 | "unknown template '{}' (only 'feature' is implemented)", |
| 148 | self.template |
| 149 | ), |
| 150 | }); |
| 151 | } |
| 152 | |
| 153 | if crate::commands::rpc::intent_new(self)? { |
| 154 | return Ok(()); |
| 155 | } |
| 156 | |
| 157 | let root = find_repository_root()?; |
| 158 | let repo = crate::commands::open_repository_with_vault(&root)?; |
| 159 | |
| 160 | let (created, kind) = |
| 161 | create_intent(&repo, &self.title, &self.kind, self.review.as_deref())?; |
| 162 | |
| 163 | println!("Created intent: {}", created.id); |
| 164 | println!(" file: .vault/{}", created.intent_file); |
| 165 | println!(" template: {}", self.template); |
| 166 | println!(" kind: {kind}"); |
| 167 | if let Some(target) = &self.review { |
| 168 | println!(" reviews: {target}"); |
| 169 | } |
| 170 | println!(); |
| 171 | println!("Edit the directive stubs, then:"); |
| 172 | println!(" atomic intent validate {}", created.id); |
| 173 | println!(" atomic intent attest {}", created.id); |
| 174 | |
| 175 | Ok(()) |
| 176 | } |
| 177 | } |
| 178 | |
| 179 | #[cfg(test)] |
nothing calls this directly
no test coverage detected