just don't pipe anything to make it show +++ no paste text +++
This commit is contained in:
parent
aca5aa61d0
commit
676cda3109
13
src/main.rs
13
src/main.rs
@ -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();
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user