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

Function print_next_steps

atomic-cli/src/output/mod.rs:259–274  ·  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

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

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