use crate::app::App;
use crate::git::git_capture;
use std::io::{self, IsTerminal};
#[derive(clap::Args)]
pub struct Args {}
pub fn run(_args: Args) {
if !io::stdout().is_terminal() {
eprintln!("slu itag needs an interactive terminal - use `git tag` instead");
std::process::exit(1);
}
let repo =
git_capture(".", &["rev-parse", "--show-toplevel"]).unwrap_or_else(|| ".".to_string());
match App::at_tags(repo) {
Some(app) => app.run("itag"),
None => {
eprintln!("slu itag: no tags here (or not a git repo) - `git tag <name>` makes one");
std::process::exit(1);
}
}
}