A shorthand for diff –short that is more discoverable
IBLJI7IAS7KNEHONURYUFRAINAMUC65HODM4G7XCRSGVIWJ7O5OQC
use clap::{Parser, ValueHint};
use std::path::PathBuf;
#[derive(Parser, Debug)]
pub struct Status {
/// Set the repository where this command should run. Defaults to the first ancestor of the current directory that contains a `.pijul` directory.
#[clap(long = "repository", value_hint = ValueHint::DirPath)]
pub repo_path: Option<PathBuf>,
/// Compare with this channel.
#[clap(long = "channel")]
pub channel: Option<String>,
/// Add all the changes of this channel as dependencies (except changes implied transitively), instead of the minimal dependencies.
#[clap(long = "tag")]
pub tag: bool,
/// Include the untracked files
#[clap(short = 'u', long = "untracked")]
pub untracked: bool,
/// Only diff those paths (files or directories). If missing, diff the entire repository.
pub prefixes: Vec<PathBuf>,
/// Use Patience diff instead of the default Myers diff
#[clap(long = "patience")]
pub patience: bool,
}
impl Status {
pub fn run(self) -> Result<(), anyhow::Error> {
// Status is just diff with benefits.
let diff = super::Diff {
repo_path: self.repo_path,
json: false,
channel: self.channel,
tag: self.tag,
short: true,
untracked: self.untracked,
prefixes: self.prefixes,
patience: false,
};
diff.run()
}
}