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))
|
.highlight_style(Style::default().bg(Color::Black))
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// set a text to display
|
||||||
pub fn set_text(&mut self, info: &str) {
|
pub fn set_text(&mut self, info: &str) {
|
||||||
self.info = String::from(info);
|
self.info = String::from(info);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// print a text to display
|
||||||
pub fn set_info(&mut self, text: &dyn std::fmt::Display) {
|
pub fn set_info(&mut self, text: &dyn std::fmt::Display) {
|
||||||
self.info = format!("{}", text);
|
self.info = format!("{}", text);
|
||||||
}
|
}
|
||||||
|
@ -34,6 +34,7 @@ pub struct ServiceSwitcher {
|
|||||||
|
|
||||||
impl ServiceSwitcher {
|
impl ServiceSwitcher {
|
||||||
pub fn new(file: &Option<PathBuf>) -> Option<Self> {
|
pub fn new(file: &Option<PathBuf>) -> Option<Self> {
|
||||||
|
//gather possible filenames
|
||||||
let mut file_list = vec![
|
let mut file_list = vec![
|
||||||
PathBuf::from("docker-compose.yml"),
|
PathBuf::from("docker-compose.yml"),
|
||||||
PathBuf::from("docker-compose.yaml"),
|
PathBuf::from("docker-compose.yaml"),
|
||||||
@ -43,6 +44,7 @@ impl ServiceSwitcher {
|
|||||||
Some(file) => file_list.insert(0, file.clone()),
|
Some(file) => file_list.insert(0, file.clone()),
|
||||||
}
|
}
|
||||||
|
|
||||||
|
//try filenames
|
||||||
for file in file_list {
|
for file in file_list {
|
||||||
let list = match File::open(&file) {
|
let list = match File::open(&file) {
|
||||||
Err(_) => continue,
|
Err(_) => continue,
|
||||||
|
Loading…
Reference in New Issue
Block a user