git_warp_time/cli.rs
1// SPDX-FileCopyrightText: © 2021 Caleb Maclennan <caleb@alerque.com>
2// SPDX-License-Identifier: GPL-3.0-only
3
4use clap::Parser;
5
6/// CLI utility that resets the timestamps of files in a Git repository working directory
7/// to the exact timestamp of the last commit which modified each file.
8#[derive(Parser, Debug)]
9#[command(author, bin_name = "git-warp-time")]
10pub struct Cli {
11 /// Include files tracked by Git but modifications in the working tee
12 #[arg(short, long)]
13 pub dirty: bool,
14
15 /// Include files tracked by Git but also ignored
16 #[arg(short, long)]
17 pub ignored: bool,
18
19 /// Only touch files that are newer than their history, ignore ones that are older
20 #[arg(short = 'o', long)]
21 pub ignore_older: bool,
22
23 /// Don't print any output about files touched or skipped
24 #[arg(short, long)]
25 pub quiet: bool,
26
27 /// Optional list of paths to operate on instead of default which is all files tracked by Git
28 #[arg(value_hint = clap::ValueHint::FilePath)]
29 pub paths: Option<Vec<String>>,
30}