MCPcopy Create free account
hub / github.com/atomicdotdev/atomic / run

Method run

atomic-cli/src/commands/insert.rs:192–212  ·  view source on GitHub ↗
(&self)

Source from the content-addressed store, hash-verified

190
191impl crate::commands::Command for Insert {
192 fn run(&self) -> CliResult<()> {
193 let repo_path = self.repository.as_ref().map(std::path::Path::new);
194 let repo = require_repository(repo_path)?;
195
196 match &self.command {
197 Some(InsertSubcommand::View(args)) => run_view_insert(&repo, args),
198 Some(InsertSubcommand::Tag(args)) => run_tag(&repo, args),
199 Some(InsertSubcommand::Change(args)) => run_change_insert(&repo, args),
200 Some(InsertSubcommand::Preview(args)) => run_preview(&repo, args),
201 None => {
202 if let Some(ref change_str) = self.change {
203 // Insert a single change into the current (or --view) view.
204 run_single_insert(&repo, change_str, self)
205 } else {
206 // No change and no subcommand: promote the current view's
207 // changes into its parent view.
208 run_promote_to_parent(&repo, self)
209 }
210 }
211 }
212 }
213}
214
215// Subcommand Implementations

Callers

nothing calls this directly

Calls 8

require_repositoryFunction · 0.85
run_view_insertFunction · 0.85
run_tagFunction · 0.85
run_change_insertFunction · 0.85
run_previewFunction · 0.85
run_single_insertFunction · 0.85
run_promote_to_parentFunction · 0.85
as_refMethod · 0.80

Tested by

no test coverage detected