diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2023-03-20 16:57:44 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2023-03-20 16:57:44 +0200 |
commit | 2ab7df378d8cb40775ac0ecd2849fa9966386a2e (patch) | |
tree | fb4c5ef0785e121c082dae9f0eca1051d879319b /src/parser.rs | |
parent | 4aaca79ed12d327328f7650b737cb47e5ed83fa7 (diff) |
Use clap to parse paths
Diffstat (limited to 'src/parser.rs')
-rw-r--r-- | src/parser.rs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/parser.rs b/src/parser.rs index 9938924..6a6459b 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -1,5 +1,5 @@ use clap::{Parser, Subcommand}; -use std::str::FromStr; +use std::{path::PathBuf, str::FromStr}; use thiserror::Error; #[derive(Parser, Clone, Debug, PartialEq, Eq)] @@ -35,14 +35,14 @@ pub struct GitUploadPackArgs { pub stateless_rpc: bool, #[arg(long)] pub advertise_refs: bool, - pub directory: String, + pub directory: PathBuf, } #[derive(Parser, Clone, Debug, PartialEq, Eq)] pub struct GitReceivePackArgs { #[arg(long)] pub http_backend_info_refs: bool, - pub directory: String, + pub directory: PathBuf, } #[derive(Error, Debug)] @@ -98,7 +98,7 @@ mod test { timeout: None, stateless_rpc: true, advertise_refs: false, - directory: "foobar.git".to_owned(), + directory: PathBuf::from("foobar.git"), }) ); } |