Setting paste name to filename (#1)

* Setting paste name to filename

* Version bump
This commit is contained in:
Tilo
2023-10-26 21:57:59 +02:00
committed by GitHub
parent daa39d1203
commit 29227ccff2
3 changed files with 4 additions and 3 deletions

2
Cargo.lock generated
View File

@@ -696,7 +696,7 @@ dependencies = [
[[package]]
name = "pastebin-cli"
version = "0.1.0"
version = "0.1.1"
dependencies = [
"anyhow",
"chrono",

View File

@@ -1,6 +1,6 @@
[package]
name = "pastebin-cli"
version = "0.1.0"
version = "0.1.1"
edition = "2021"
description = "A simple CLI for pastebin.com"
authors = ["Tilo K"]

View File

@@ -32,13 +32,14 @@ pub async fn create_paste(
map.insert("api_paste_code", content);
map.insert("api_paste_private", "0".to_owned());
map.insert("api_paste_expire_date", "1W".to_owned());
map.insert("api_paste_name", name);
if paste_id.is_some() {
let id = paste_id.unwrap();
map.insert("api_paste_key", id);
}
let mut req = client
let req = client
.post("https://pastebin.com/api/api_post.php")
.form(&map);