acr-cli 0.3.4

A CLI tool for AtCoder competitive programming in Rust
1
2
3
4
5
6
7
8
9
10
11
12
13
14
use crate::config;

/// Open a URL in the user's configured browser.
pub fn open(url: &str) {
    let browser = config::global::load()
        .map(|c| c.browser)
        .unwrap_or_else(|_| "xdg-open".to_string());
    let _ = std::process::Command::new(&browser)
        .arg(url)
        .stdin(std::process::Stdio::null())
        .stdout(std::process::Stdio::null())
        .stderr(std::process::Stdio::null())
        .spawn();
}