added some comments
This commit is contained in:
parent
79577de0f9
commit
eec1836dd3
@ -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);
|
||||
}
|
||||
|
@ -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,
|
||||
|
Loading…
Reference in New Issue
Block a user