vdev/commands/meta/starship.rs
1use anyhow::Result;
2use clap::Args;
3
4use crate::util::CargoToml;
5
6/// Custom Starship prompt plugin
7#[derive(Args, Debug)]
8#[command(hide = true)]
9pub struct Cli {}
10
11impl Cli {
12 pub fn exec(self) -> Result<()> {
13 let mut contexts = vec![];
14
15 if let Ok(cargo_toml) = CargoToml::load() {
16 contexts.push(format!("version: {}", cargo_toml.package.version));
17 }
18
19 println!("vector{{ {} }}", contexts.join(", "));
20
21 Ok(())
22 }
23}