Skip to content

Commit

Permalink
feat: start of command line interface
Browse files Browse the repository at this point in the history
  • Loading branch information
ccrutchf committed Nov 16, 2024
1 parent 8311b3d commit f7dbcc9
Show file tree
Hide file tree
Showing 2 changed files with 39 additions and 2 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -4,4 +4,4 @@ version = "0.1.0"
edition = "2021"

[dependencies]

clap = "4.5.21"
39 changes: 38 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
@@ -1,3 +1,40 @@
use clap::{Command, Arg};

fn cli() -> Command {
Command::new("git-lfs-synology")
.about("This is an implementation of a git lfs custom transfer agent. See https://github.com/git-lfs/git-lfs/blob/main/docs/custom-transfers.md for mor information.")
.allow_external_subcommands(true)
.subcommand(
Command::new("login")
.about("Allows logging into the Synology NAS.")
.args_conflicts_with_subcommands(true)
.flatten_help(true)
.arg(
Arg::new("USER")
.short('u')
.long("user")
.required(true)
.help("The username for the Synology NAS")
)
.arg(
Arg::new("URL")
.short('l')
.long("url")
.required(true)
.help("The URL for the Synology NAS")
)
)
}

fn main() {
println!("Hello, world!");
let matches = cli().get_matches();

match matches.subcommand() {
Some(("login", sub_matches)) => {
println!("{:?}", sub_matches);

println!("login")
},
_ => println!("No subcommand")
}
}

0 comments on commit f7dbcc9

Please sign in to comment.