aboutsummaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorIvan Tham <[email protected]>2018-08-08 07:41:59 +0100
committerIvan Tham <[email protected]>2018-08-08 07:41:59 +0100
commit8bf57f64b930b65367a5ddb072a13b1e9354c8f0 (patch)
tree95194b1fd6b07f677c760b1c711f929641df3b7c /src
parent89b811bbadca81a386080f294c5e9cd811b3eac0 (diff)
Check LANG before default to en
Diffstat (limited to 'src')
-rw-r--r--src/main.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/main.rs b/src/main.rs
index 90eed78..25e6e32 100644
--- a/src/main.rs
+++ b/src/main.rs
@@ -72,7 +72,10 @@ fn parse_arguments() -> Configuration {
72 std::process::exit(0); 72 std::process::exit(0);
73 } 73 }
74 74
75 let lang = matches.value_of("lang").unwrap_or("en").to_string(); 75 let lang = matches
76 .value_of("lang")
77 .or(option_env!("LANG").map(|s| s.split_at(2).0))
78 .unwrap_or("en");
76 let wiki_url = matches 79 let wiki_url = matches
77 .value_of("URL") 80 .value_of("URL")
78 .unwrap_or(&format!("https://{}.wikipedia.org", lang)) 81 .unwrap_or(&format!("https://{}.wikipedia.org", lang))