Skip to content
Snippets Groups Projects
Commit 18e92e9a authored by iliya.saroukha's avatar iliya.saroukha
Browse files

storing print to stdout functions into separate file

parent 3d945ec0
Branches
No related tags found
No related merge requests found
use ptree::{print_tree, TreeBuilder};
pub fn algo_tree() {
let tree = TreeBuilder::new("<name_data_struct>".to_string())
.begin_child("struct".to_string())
.add_empty_child("<name_data_struct>.h".to_string())
.add_empty_child("<name_data_struct>.c".to_string())
.end_child()
.add_empty_child("<name_main_file>.c".to_string())
.add_empty_child("Makefile".to_string())
.build();
print_tree(&tree).expect("Not able to print");
println!();
}
pub fn exam_tree() {
let tree = TreeBuilder::new("prog_seq_exam_<month>".to_string())
.begin_child("ex1".to_string())
.add_empty_child("ex1.c".to_string())
.add_empty_child("Makefile".to_string())
.end_child()
.begin_child("ex...".to_string())
.add_empty_child("etc...".to_string())
.end_child()
.build();
print_tree(&tree).expect("Not able to print");
println!();
}
pub fn print_menu() {
println!();
println!(" --------------------------------------- ");
println!("|\tWelcome to CREATE-PROG-APP\t|");
println!(" --------------------------------------- ");
println!("What kind of template do you want?");
println!();
println!("1) Algo");
algo_tree();
println!("2) Exam");
exam_tree();
}
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment