args-cli 0.1.1

Command-line interface for args
Documentation
1
2
3
4
5
6
7
8
9
10
11
use crate::config::runner::RUNNER_CONFIG_PATH;

pub async fn config() -> anyhow::Result<()> {
    let editor = std::env::var("VISUAL")
        .or_else(|_| std::env::var("EDITOR"))
        .unwrap_or_else(|_| "vi".to_string());

    println!("Editing {}", RUNNER_CONFIG_PATH);

    crate::util::run_command("sudo", &[&editor, RUNNER_CONFIG_PATH])
}