diff options
Diffstat (limited to 'src')
-rw-r--r-- | src/main.rs | 5 |
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)) |