git_gamble/git_time_keeper/
cli.rs

1use clap::Parser;
2
3pub const DEFAULT_TIMEOUT_COMMAND: &str = "git reset --hard";
4
5#[derive(clap::Args, PartialEq)]
6pub struct Args {
7	#[arg(long, env = "TIME_KEEPER_MAXIMUM_ITERATION_DURATION")]
8	pub iteration_duration: u16,
9
10	#[arg(default_value = DEFAULT_TIMEOUT_COMMAND)]
11	pub timeout_command: String,
12}
13
14#[derive(Parser, PartialEq)]
15#[command(
16	version,
17	about = "git-time-keeper is a tool that helps to take baby steps 👶🦶",
18	after_help(
19		"Any contributions (feedback, bug report, merge request ...) are welcome\n".to_string() +
20		"https://git-gamble.is-cool.dev/contributing/index.html"
21	)
22)]
23pub enum Cli {
24	/// Start the time keeper in background
25	Start(Args),
26
27	#[command(
28		about = "The actual time keeper that is ran in background",
29		long_about(
30			"The actual time keeper that is ran in background\n".to_string() +
31			"\n" +
32			"For internal use only"
33		)
34	)]
35	Background(Args),
36
37	/// Stop the time keeper
38	Stop,
39}
40
41#[test]
42fn verify_app() {
43	use clap::CommandFactory;
44
45	Cli::command().debug_assert()
46}