Skip to main content

ssec_cli/
cli.rs

1use clap::{Parser, Subcommand, Args};
2
3#[derive(Parser)]
4#[command(version, about)]
5pub struct Cli {
6	#[command(subcommand)]
7	pub command: Command
8}
9
10#[derive(Subcommand)]
11pub enum Command {
12	Enc(EncArgs),
13	Dec(DecArgs),
14	Fetch(FetchArgs),
15	Chaff(ChaffArgs)
16}
17
18#[derive(Args)]
19pub struct EncArgs {
20	#[arg(value_hint = clap::ValueHint::FilePath)]
21	pub in_file: std::path::PathBuf,
22
23	#[arg(value_hint = clap::ValueHint::FilePath)]
24	pub out_file: Option<std::path::PathBuf>,
25
26	#[arg(long)]
27	pub silent: bool
28}
29
30#[derive(Args)]
31pub struct DecArgs {
32	#[arg(value_hint = clap::ValueHint::FilePath)]
33	pub in_file: std::path::PathBuf,
34
35	#[arg(value_hint = clap::ValueHint::FilePath)]
36	pub out_file: std::path::PathBuf,
37
38	#[arg(long)]
39	pub silent: bool
40}
41
42#[derive(Args)]
43pub struct FetchArgs {
44	pub url: url::Url,
45
46	#[arg(value_hint = clap::ValueHint::FilePath)]
47	pub out_file: std::path::PathBuf,
48
49	#[arg(long)]
50	pub silent: bool
51}
52
53#[derive(Args)]
54pub struct ChaffArgs {
55	#[arg(value_hint = clap::ValueHint::FilePath)]
56	pub out_file: std::path::PathBuf,
57
58	#[arg(long, value_hint = clap::ValueHint::Other)]
59	pub size: String,
60
61	#[arg(long, value_hint = clap::ValueHint::Other)]
62	pub random_size_max: Option<String>,
63
64	// TODO: implement progress bar and use this value
65	#[arg(long)]
66	pub silent: bool
67}