guild 0.1.1

Guild is a Command Line Interface build with Rust that posts code snippets to a Discord channel using Webhooks.
Documentation
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use clap::ArgMatches;

mod arg_parser;
mod discord;

pub async fn run(args: &ArgMatches<'_>) -> Result<(), Box<dyn std::error::Error>> {
    match args.subcommand_name() {
        Some("post") => {
            let snippet = arg_parser::retrieve_snippet(args)?;
            discord::execute_webhook(&snippet[..]).await?;
        }
        Some("set") => arg_parser::set_webhook_info(args).await?,
        _ => unreachable!(),
    }

    Ok(())
}