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

Function print_next_steps

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

213/// atomic status See what's changed
214/// ```
215pub fn print_next_steps(steps: &[(&str, &str)]) {
216 if steps.is_empty() {
217 return;
218 }
219
220 println!();
221 println!("{}", hint("Next steps:"));
222
223 // Calculate max command width for alignment
224 let max_cmd_width = steps.iter().map(|(cmd, _)| cmd.len()).max().unwrap_or(0);
225
226 for (cmd, desc) in steps {
227 let padding = max_cmd_width - cmd.len() + 2;
228 println!(" {}{}{}", command(cmd), " ".repeat(padding), hint(desc));
229 }
230}
231
232// Confirmation Prompt
233

Callers 8

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