added some comments

This commit is contained in:
Thomas Eppers 2021-11-03 15:39:32 +01:00
parent 79577de0f9
commit eec1836dd3
2 changed files with 4 additions and 0 deletions

View File

@ -27,10 +27,12 @@ impl Info {
.highlight_style(Style::default().bg(Color::Black))
}
/// set a text to display
pub fn set_text(&mut self, info: &str) {
self.info = String::from(info);
}
/// print a text to display
pub fn set_info(&mut self, text: &dyn std::fmt::Display) {
self.info = format!("{}", text);
}

View File

@ -34,6 +34,7 @@ pub struct ServiceSwitcher {
impl ServiceSwitcher {
pub fn new(file: &Option<PathBuf>) -> Option<Self> {
//gather possible filenames
let mut file_list = vec![
PathBuf::from("docker-compose.yml"),
PathBuf::from("docker-compose.yaml"),
@ -43,6 +44,7 @@ impl ServiceSwitcher {
Some(file) => file_list.insert(0, file.clone()),
}
//try filenames
for file in file_list {
let list = match File::open(&file) {
Err(_) => continue,