We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
open
OPEN_WITH
1 parent b4592a4 commit 659b8a0Copy full SHA for 659b8a0
src/main.rs
@@ -9,7 +9,12 @@ fn main() {
9
}
10
};
11
12
- match open::that(&path_or_url) {
+ let result = match std::env::var("OPEN_WITH").ok() {
13
+ Some(program) => open::with(&path_or_url, program),
14
+ None => open::that(&path_or_url),
15
+ };
16
+
17
+ match result {
18
Ok(()) => println!("Opened '{}' successfully.", path_or_url),
19
Err(err) => {
20
eprintln!("An error occurred when opening '{}': {}", path_or_url, err);
0 commit comments