summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--src/main.rs3
-rw-r--r--src/path.rs3
-rw-r--r--src/poem/recite.rs4
3 files changed, 6 insertions, 4 deletions
diff --git a/src/main.rs b/src/main.rs
index 9f7e63c..6a51496 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -2,7 +2,6 @@ use std::io::{self, Write};
use std::path::Path;
use std::sync::{Arc, Mutex};
mod path;
-use path::prefresh;
mod poem;
use poem::{read::Readable, recite::Reciteable, Poem};
@@ -24,7 +23,7 @@ use poem::{read::Readable, recite::Reciteable, Poem};
/// ```
fn repl(path: &Vec<&Path>, prompt: &str, at_prompt: &mut Arc<Mutex<bool>>) {
// Initial path refresh on startup
- let mut bins: Vec<String> = prefresh(path);
+ let mut bins: Vec<String> = path::refresh(path);
// Main shell loop
loop {
diff --git a/src/path.rs b/src/path.rs
index 28eb45b..412489b 100644
--- a/src/path.rs
+++ b/src/path.rs
@@ -17,11 +17,14 @@ use std::path::Path;
/// let path = vec!["/bin"];
/// let path = path.into_iter().map(Path::new).collect();
/// let mut bins = prefresh(&path);
+/// let mut bins = path::refresh(&path);
/// ...
/// // A situation occurs where the $PATH needs to be refreshed
/// bins = prefresh(&path)
+/// bins = path::refresh(&path)
/// ```
pub fn prefresh(path: &Vec<&Path>) -> Vec<String> {
+pub fn refresh(path: &Vec<&Path>) -> Vec<String> {
let mut bins: Vec<String> = Vec::new();
for p in path {
diff --git a/src/poem/recite.rs b/src/poem/recite.rs
index 1d41c40..f28436e 100644
--- a/src/poem/recite.rs
+++ b/src/poem/recite.rs
@@ -1,6 +1,6 @@
mod ps;
use super::Poem;
-use crate::path::prefresh;
+use crate::path;
use crate::poem::elements::rune::Rune;
use std::env;
use std::process::exit;
@@ -159,7 +159,7 @@ impl Reciteable for Poem {
// again
// If it still doesn't exist, print an error
if !verse.spellcheck(bins) {
- *bins = prefresh(path);
+ *bins = path::refresh(path);
if !verse.spellcheck(bins) {
eprintln!("dwvsh: {}: command not found", verse.verb());