Skip to content

Commit

Permalink
fix long name of new sort flag
Browse files Browse the repository at this point in the history
  • Loading branch information
henninggross committed Jan 25, 2024
1 parent 47b23fa commit 1bdbef4
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -45,7 +45,7 @@ Options:
-m, --month MONTH Set Month to search timetable for (default: today's month)
-y, --year YEAR Set Year to search timetable for (default: today's year)
-w, --wait SECONDS Set Wait time in seconds for Renfe search result page (default: 2)
-s, --sorted Option to sort the timetable by Duration
-s, --sort Option to sort the timetable by Duration
-h, --help Print this help menu
```

Expand Down
12 changes: 6 additions & 6 deletions src/timetable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -109,39 +109,39 @@ pub fn search_timetable(
.unwrap()
.click()
.unwrap();
let elem = tab.type_str(&origin).unwrap();
let elem = tab.type_str(&origin).unwrap();
elem.press_key("Tab").unwrap();

println!("adding destination station");
tab.find_element_by_xpath(r#"//*[@id="D"]"#)
.unwrap()
.click()
.unwrap();
let elem = tab.type_str(&destination).unwrap();
let elem = tab.type_str(&destination).unwrap();
elem.press_key("Tab").unwrap();

println!("adding day");
tab.find_element_by_xpath(r#"//*[@id="DF"]"#)
.unwrap()
.click()
.unwrap();
let elem = tab.type_str(&day).unwrap();
let elem = tab.type_str(&day).unwrap();
elem.press_key("Tab").unwrap();

println!("adding month");
tab.find_element_by_xpath(r#"//*[@id="MF"]"#)
.unwrap()
.click()
.unwrap();
tab.type_str(&to_renfe_month(month)).unwrap();
tab.type_str(&to_renfe_month(month)).unwrap();
elem.press_key("Tab").unwrap();

println!("adding year");
tab.find_element_by_xpath(r#"//*[@id="AF"]"#)
.unwrap()
.click()
.unwrap();
let elem = tab.type_str(&year).unwrap();
let elem = tab.type_str(&year).unwrap();
elem.press_key("Tab").unwrap();

println!("searching timetable");
Expand All @@ -152,7 +152,7 @@ let elem = tab.type_str(&year).unwrap();

sleep(Duration::from_secs(wait));

// wait on navigating to search result page
// wait on navigating to search result page
tab.wait_until_navigated()
.unwrap()
.wait_for_elements_by_xpath(r#"//*[@id="contenedor"]"#)
Expand Down

0 comments on commit 1bdbef4

Please sign in to comment.