diff --git a/src/main.rs b/src/main.rs index 810085e..acf0bad 100644 --- a/src/main.rs +++ b/src/main.rs @@ -352,6 +352,7 @@ enum UploadAction { Upload(u64), Skip, New, + Delete, } struct ParseUploadActionErr; impl std::str::FromStr for UploadAction { @@ -361,6 +362,8 @@ impl std::str::FromStr for UploadAction { Ok(Self::Skip) }else if s=="new\n"{ Ok(Self::New) + }else if s=="delete\n"{ + Ok(Self::Delete) }else if let Ok(asset_id)=s[..s.len()-1].parse::(){ Ok(Self::Upload(asset_id)) }else{ @@ -435,6 +438,7 @@ fn upload() -> BoxResult<()>{ None => println!("no status code!"), } } + UploadAction::Delete => std::fs::remove_file(file_thing.path())?, } } Ok(())