aboutsummaryrefslogtreecommitdiff
path: root/src/arguments.rs
diff options
context:
space:
mode:
authorottjk <joshott16@gmail.com>2023-12-30 19:40:27 -0500
committerottjk <joshott16@gmail.com>2023-12-30 19:40:27 -0500
commit6536f3aae95e266f80a5a73288e181ff10ce650b (patch)
tree2fa309c246ab4ad860da8673a82dcb4ead924919 /src/arguments.rs
downloaddfa-6536f3aae95e266f80a5a73288e181ff10ce650b.tar.gz
dfa-6536f3aae95e266f80a5a73288e181ff10ce650b.zip
initial commit
Diffstat (limited to 'src/arguments.rs')
-rw-r--r--src/arguments.rs59
1 files changed, 59 insertions, 0 deletions
diff --git a/src/arguments.rs b/src/arguments.rs
new file mode 100644
index 0000000..24697d9
--- /dev/null
+++ b/src/arguments.rs
@@ -0,0 +1,59 @@
+use clap::{Parser,Subcommand,Args};
+use std::path::PathBuf;
+
+#[derive(Parser)]
+pub struct Cli {
+ #[command(subcommand)]
+ pub command: Commands,
+
+ /// Configuration file location
+ #[arg(short, long)]
+ pub config: Option<PathBuf>,
+}
+
+#[derive(Subcommand)]
+pub enum Commands {
+ /// Add or update config from list
+ Modify(ModifyArgs),
+
+ /// Remove program from list
+ Remove(RemoveArgs),
+
+ /// Print list of tracked configs
+ List {},
+
+ /// Update a config
+ Sync(SyncArgs),
+}
+
+#[derive(Args)]
+pub struct ModifyArgs {
+ /// Name of program
+ pub name: String,
+
+ /// Parent directory on system config resides in
+ pub dest: PathBuf,
+
+ /// File(s) in configs directory
+ pub file: PathBuf,
+}
+
+#[derive(Args)]
+pub struct RemoveArgs {
+ /// Name of program
+ pub name: String,
+}
+
+#[derive(Args)]
+pub struct SyncArgs {
+ /// Names of programs to update
+ pub names: Vec<String>,
+
+ /// Sync all programs
+ #[arg(short, long)]
+ pub all: bool,
+
+ /// Never prompt to skip
+ #[arg(short, long)]
+ pub force: bool,
+}