grit/command/
trunk.rs

1use std::env;
2
3use crate::error::{Error, Result};
4
5/// Prints the name of the local trunk branch, if any is identified.
6///
7/// # Errors
8///
9/// Returns an error if `args` is nonempty, or no local trunk can be identified.
10pub async fn trunk(mut args: env::ArgsOs) -> Result<()> {
11    if let Some(arg) = args.next() {
12        return Err(Error::Arg(arg));
13    }
14    println!("{}", crate::trunk::local().await?);
15    Ok(())
16}