mirror of
https://github.com/Tilo-K/pastebin-cli.git
synced 2026-01-09 16:31:01 +00:00
Setting paste name to filename (#1)
* Setting paste name to filename * Version bump
This commit is contained in:
2
Cargo.lock
generated
2
Cargo.lock
generated
@@ -696,7 +696,7 @@ dependencies = [
|
|||||||
|
|
||||||
[[package]]
|
[[package]]
|
||||||
name = "pastebin-cli"
|
name = "pastebin-cli"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
dependencies = [
|
dependencies = [
|
||||||
"anyhow",
|
"anyhow",
|
||||||
"chrono",
|
"chrono",
|
||||||
|
|||||||
@@ -1,6 +1,6 @@
|
|||||||
[package]
|
[package]
|
||||||
name = "pastebin-cli"
|
name = "pastebin-cli"
|
||||||
version = "0.1.0"
|
version = "0.1.1"
|
||||||
edition = "2021"
|
edition = "2021"
|
||||||
description = "A simple CLI for pastebin.com"
|
description = "A simple CLI for pastebin.com"
|
||||||
authors = ["Tilo K"]
|
authors = ["Tilo K"]
|
||||||
|
|||||||
@@ -32,13 +32,14 @@ pub async fn create_paste(
|
|||||||
map.insert("api_paste_code", content);
|
map.insert("api_paste_code", content);
|
||||||
map.insert("api_paste_private", "0".to_owned());
|
map.insert("api_paste_private", "0".to_owned());
|
||||||
map.insert("api_paste_expire_date", "1W".to_owned());
|
map.insert("api_paste_expire_date", "1W".to_owned());
|
||||||
|
map.insert("api_paste_name", name);
|
||||||
|
|
||||||
if paste_id.is_some() {
|
if paste_id.is_some() {
|
||||||
let id = paste_id.unwrap();
|
let id = paste_id.unwrap();
|
||||||
map.insert("api_paste_key", id);
|
map.insert("api_paste_key", id);
|
||||||
}
|
}
|
||||||
|
|
||||||
let mut req = client
|
let req = client
|
||||||
.post("https://pastebin.com/api/api_post.php")
|
.post("https://pastebin.com/api/api_post.php")
|
||||||
.form(&map);
|
.form(&map);
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user