Files
jj-cz/src/cli/mod.rs
T

33 lines
1.0 KiB
Rust
Raw Normal View History

use clap::Parser;
/// Interactive conventional commit tool for Jujutsu
///
/// Guides you through creating a properly formatted conventional commit message
/// and applies it to the current change in your Jujutsu repository.
#[derive(Debug, Parser)]
#[command(
name = "jj-cz",
version,
about = "Interactive conventional commit tool for Jujutsu",
long_about = "Guides you through creating a properly formatted conventional \
commit message and applies it to the current change in your \
Jujutsu repository.\n\n\
This tool requires an interactive terminal (TTY)."
)]
2026-04-05 23:02:14 +02:00
pub struct Cli {
/// The revision(s) whose description to edit (default: @)
#[arg(value_name = "REVSETS")]
revsets: Vec<String>,
}
impl Cli {
/// Returns the revsets to operate on, defaulting to `["@"]` if none provided
pub fn revsets(&self) -> Vec<&str> {
if self.revsets.is_empty() {
vec!["@"]
} else {
self.revsets.iter().map(|s| s.as_str()).collect()
}
}
}