diff options
author | Justin Wernick <justin@worthe-it.co.za> | 2023-04-08 19:41:37 +0200 |
---|---|---|
committer | Justin Wernick <justin@worthe-it.co.za> | 2023-04-08 19:41:37 +0200 |
commit | ff5e3b4dd718e622d81e02c50786c2ec3d5437ae (patch) | |
tree | 9de8bebab5d9d5875744d51f3176d9301fb68007 /src | |
parent | c21d81998d3cf573a4b0333f81c22494906cb111 (diff) |
Fill in test for updating description on existing repo
This also isn't implemented yet. Naughty naughty.
Diffstat (limited to 'src')
-rw-r--r-- | src/git.rs | 4 | ||||
-rw-r--r-- | src/lib.rs | 7 | ||||
-rw-r--r-- | src/parser.rs | 7 |
3 files changed, 18 insertions, 0 deletions
@@ -170,6 +170,10 @@ pub fn list() -> Result<Vec<RepoMetadata>, ShackleError> { Ok(results) } +pub fn set_description(_directory: &PathBuf, _description: &str) -> Result<(), ShackleError> { + todo!() +} + pub fn upload_pack(upload_pack_args: &GitUploadPackArgs) -> Result<(), ShackleError> { if !is_valid_git_repo_path(&upload_pack_args.directory)? { return Err(ShackleError::InvalidDirectory); @@ -26,6 +26,13 @@ pub fn run_command(user_input: String) -> Result<ControlFlow<(), ()>, ShackleErr println!("{table}"); } + Ok(ShackleCommand::SetDescription(SetDescriptionArgs { + directory, + description, + })) => { + git::set_description(&directory, &description)?; + println!("Successfully updated description"); + } Ok(ShackleCommand::GitInit(GitInitArgs { repo_name, group, diff --git a/src/parser.rs b/src/parser.rs index 5295483..fd8ab75 100644 --- a/src/parser.rs +++ b/src/parser.rs @@ -13,12 +13,19 @@ pub enum ShackleCommand { Exit, /// List all repositories available List, + SetDescription(SetDescriptionArgs), GitInit(GitInitArgs), GitUploadPack(GitUploadPackArgs), GitReceivePack(GitReceivePackArgs), } #[derive(Parser, Clone, Debug, PartialEq, Eq)] +pub struct SetDescriptionArgs { + pub directory: PathBuf, + pub description: String, +} + +#[derive(Parser, Clone, Debug, PartialEq, Eq)] pub struct GitInitArgs { #[arg(long)] pub group: Option<String>, |