mod indicators { pub mod error; pub mod git; pub mod ssh; pub mod user; } use crate::indicators::error; use crate::indicators::git; use crate::indicators::ssh; use crate::indicators::user; fn main() { let cmd_args: Vec = std::env::args().collect(); let mut prompt: String = String::new(); let indicate_user: bool = true; let indicate_ssh: bool = true; let indicate_err: bool = true; let indicate_git_branch: bool = true; if indicate_ssh { prompt += &ssh::indicator().to_string(); } if indicate_git_branch { let git_info = git::info(); match git_info { Some((_repo, branch)) => prompt += &git::indicator(Some(branch)).to_string(), None => prompt += &git::indicator(None).to_string(), }; } if indicate_user { prompt += &user::indicator().to_string(); } if indicate_err { prompt += &error::indicator(cmd_args).to_string(); } print!("{prompt} "); }