diff options
author | Canop <cano.petrole@gmail.com> | 2018-11-23 21:32:58 +0100 |
---|---|---|
committer | Canop <cano.petrole@gmail.com> | 2018-11-23 21:32:58 +0100 |
commit | 1a56633b7d9d8cf7f99fd4d44f60ed8365682d27 (patch) | |
tree | 5ef0c680258030c16bf939d6295ca5404b84d624 /src/external.rs | |
parent | 2781f6b62df8bc84fae0f092b3f3694bfc56a147 (diff) |
more command parsing, POC of file opening
Diffstat (limited to 'src/external.rs')
-rw-r--r-- | src/external.rs | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/src/external.rs b/src/external.rs new file mode 100644 index 0000000..a2911a3 --- /dev/null +++ b/src/external.rs @@ -0,0 +1,10 @@ +use std::process::Command; +use std::path::{PathBuf}; + +pub fn open_file(path: &PathBuf) { + Command::new("xdg-open") + .arg(String::from(path.to_string_lossy())) + .spawn() + .expect("xdg-open failed to start"); +} + |