git-meta-cli 0.1.0

Command-line tool for structured Git metadata (get/set, serialize, materialize, push/pull). Installs the `git-meta` binary.
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
use anyhow::Result;

use crate::context::CommandContext;
use git_meta_lib::types::Target;

pub fn run(target_str: &str, key: &str) -> Result<()> {
    let ctx = CommandContext::open(None)?;
    let target = ctx.session.resolve_target(&Target::parse(target_str)?)?;

    let removed = ctx.session.target(&target).remove(key)?;

    if !removed {
        eprintln!("key '{key}' not found");
    }

    Ok(())
}