just don't pipe anything to make it show +++ no paste text +++

This commit is contained in:
winwinner 2023-11-22 17:38:26 +00:00
parent aca5aa61d0
commit 676cda3109
Signed by: winneratwin
GPG Key ID: F11B4D71AD94CFB8

View File

@ -26,9 +26,9 @@ struct Cli {
#[arg(short, long)]
password: Option<String>, // used
#[arg(long)]
filename: Option<String>,
filename: Option<String>, // used
#[arg(short, long)]
attachment: Option<PathBuf>,
attachment: Option<PathBuf>, // used
}
#[derive(Deserialize, Debug, Serialize, Clone, ValueEnum)]
@ -46,7 +46,7 @@ pub enum PasteFormat {
#[skip_serializing_none]
#[derive(Deserialize, Debug, Serialize)]
struct PasteData {
paste: Option<String>, // text of paste
paste: String, // text of paste
attachment: Option<String>, // data URI (rfc 2397)
attachment_name: Option<String>, // filename of attachment
chilren: Option<Vec<String>>, // idk what this is. will never use it probably
@ -65,16 +65,11 @@ fn main() {
//println!("{}", input);
let input = match input.is_empty() {
true => None,
false => Some(input)
};
let pasteurl = create_paste(cli, input);
println!("{}", pasteurl);
}
fn create_paste(cfg: Cli, input: Option<String>) -> String {
fn create_paste(cfg: Cli, input: String) -> String {
use base64::{engine::general_purpose::STANDARD as b64, Engine as _};
let mut rng = rand::thread_rng();