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

Function print_next_steps

atomic-cli/src/output/mod.rs:258–273  ·  view source on GitHub ↗

Print a "next steps" section to guide users. This function formats a list of suggested commands that the user might want to run next. It's designed to help users learn the workflow and discover related commands. # Arguments `steps` - A slice of (command, description) pairs # Example ```rust,ignore print_next_steps(&[ ("atomic add ", "Add files to track"), ("atomic record -m \"...\"", "

(steps: &[(&str, &str)])

Source from the content-addressed store, hash-verified

256/// atomic status See what's changed
257/// ```
258pub fn print_next_steps(steps: &[(&str, &str)]) {
259 if steps.is_empty() {
260 return;
261 }
262
263 println!();
264 println!("{}", hint("Next steps:"));
265
266 // Calculate max command width for alignment
267 let max_cmd_width = steps.iter().map(|(cmd, _)| cmd.len()).max().unwrap_or(0);
268
269 for (cmd, desc) in steps {
270 let padding = max_cmd_width - cmd.len() + 2;
271 println!(" {}{}{}", command(cmd), " ".repeat(padding), hint(desc));
272 }
273}
274
275// Confirmation Prompt
276

Callers 9

project_initFunction · 0.85
runMethod · 0.85
runMethod · 0.85
runMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85
executeMethod · 0.85

Calls 3

is_emptyMethod · 0.45
iterMethod · 0.45
lenMethod · 0.45

Tested by

no test coverage detected