5 Commits

Author SHA1 Message Date
dependabot[bot]
19e228563e Chore(deps): Bump openssl in the cargo group across 1 directory
Bumps the cargo group with 1 update in the / directory: [openssl](https://github.com/sfackler/rust-openssl).


Updates `openssl` from 0.10.63 to 0.10.72
- [Release notes](https://github.com/sfackler/rust-openssl/releases)
- [Commits](https://github.com/sfackler/rust-openssl/compare/openssl-v0.10.63...openssl-v0.10.72)

---
updated-dependencies:
- dependency-name: openssl
  dependency-version: 0.10.72
  dependency-type: indirect
  dependency-group: cargo
...

Signed-off-by: dependabot[bot] <support@github.com>
2025-05-16 20:12:26 +00:00
Tilo
50e663f88d v0.1.8 (#9)
Co-authored-by: Tilo <Tilo-K@users.noreply.github.com>
Co-authored-by: Tilo-K <tiloklarenbeek@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2025-05-16 22:11:32 +02:00
f5b49e2b86 0.1.7 2024-05-07 20:40:22 +02:00
Tilo
9c5baf87e5 Develop (#7)
* Setting paste name to filename

* Version bump

* Bump mio from 0.8.10 to 0.8.11 (#2)

* Setting paste name to filename (#1)

* Setting paste name to filename

* Version bump

* chore: Update dependencies

* chore: version bump

* License update

* chore: license

* Bump mio from 0.8.10 to 0.8.11

Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tilo <Tilo-K@users.noreply.github.com>
Co-authored-by: Tilo-K <tiloklarenbeek@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: added releases

* Lockfile

* Maybe fix regex

* ver: 1.0.5

* homepage & release

* fixed

* we are getting dirty

* fix

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 20:37:18 +02:00
Tilo
8d3f195ea7 Develop (#6)
* Setting paste name to filename

* Version bump

* Bump mio from 0.8.10 to 0.8.11 (#2)

* Setting paste name to filename (#1)

* Setting paste name to filename

* Version bump

* chore: Update dependencies

* chore: version bump

* License update

* chore: license

* Bump mio from 0.8.10 to 0.8.11

Bumps [mio](https://github.com/tokio-rs/mio) from 0.8.10 to 0.8.11.
- [Release notes](https://github.com/tokio-rs/mio/releases)
- [Changelog](https://github.com/tokio-rs/mio/blob/master/CHANGELOG.md)
- [Commits](https://github.com/tokio-rs/mio/compare/v0.8.10...v0.8.11)

---
updated-dependencies:
- dependency-name: mio
  dependency-type: indirect
...

Signed-off-by: dependabot[bot] <support@github.com>

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: Tilo <Tilo-K@users.noreply.github.com>
Co-authored-by: Tilo-K <tiloklarenbeek@gmail.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>

* feat: added releases

* Lockfile

* Maybe fix regex

* ver: 1.0.5

---------

Signed-off-by: dependabot[bot] <support@github.com>
Co-authored-by: dependabot[bot] <49699333+dependabot[bot]@users.noreply.github.com>
2024-05-07 17:10:24 +02:00
4 changed files with 34 additions and 15 deletions

View File

@@ -40,7 +40,7 @@ permissions:
on: on:
push: push:
tags: tags:
- '**[0-9]+.[0-9]+.[0-9]+*' - '[0-9]+.[0-9]+.[0-9]+'
pull_request: pull_request:
jobs: jobs:

10
Cargo.lock generated
View File

@@ -679,9 +679,9 @@ checksum = "3fdb12b2476b595f9358c5161aa467c2438859caa136dec86c26fdd2efe17b92"
[[package]] [[package]]
name = "openssl" name = "openssl"
version = "0.10.63" version = "0.10.72"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "15c9d69dd87a29568d4d017cfe8ec518706046a05184e5aea92d0af890b803c8" checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da"
dependencies = [ dependencies = [
"bitflags 2.4.2", "bitflags 2.4.2",
"cfg-if", "cfg-if",
@@ -711,9 +711,9 @@ checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf"
[[package]] [[package]]
name = "openssl-sys" name = "openssl-sys"
version = "0.9.99" version = "0.9.108"
source = "registry+https://github.com/rust-lang/crates.io-index" source = "registry+https://github.com/rust-lang/crates.io-index"
checksum = "22e1bf214306098e4832460f797824c05d25aacdf896f64a985fb0fd992454ae" checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847"
dependencies = [ dependencies = [
"cc", "cc",
"libc", "libc",
@@ -746,7 +746,7 @@ dependencies = [
[[package]] [[package]]
name = "pastebin-cli" name = "pastebin-cli"
version = "0.1.5" version = "0.1.8"
dependencies = [ dependencies = [
"anyhow", "anyhow",
"chrono", "chrono",

View File

@@ -1,6 +1,6 @@
[package] [package]
name = "pastebin-cli" name = "pastebin-cli"
version = "0.1.5" version = "0.1.8"
edition = "2021" edition = "2021"
description = "A simple CLI for pastebin.com" description = "A simple CLI for pastebin.com"
authors = ["Tilo K"] authors = ["Tilo K"]
@@ -41,7 +41,12 @@ ci = "github"
# The installers to generate for each app # The installers to generate for each app
installers = ["shell", "powershell", "npm", "homebrew", "msi"] installers = ["shell", "powershell", "npm", "homebrew", "msi"]
# Target platforms to build apps for (Rust target-triple syntax) # Target platforms to build apps for (Rust target-triple syntax)
targets = ["aarch64-apple-darwin", "x86_64-apple-darwin", "x86_64-unknown-linux-gnu", "x86_64-pc-windows-msvc"] targets = [
"aarch64-apple-darwin",
"x86_64-apple-darwin",
"x86_64-unknown-linux-gnu",
"x86_64-pc-windows-msvc",
]
# The archive format to use for windows builds (defaults .zip) # The archive format to use for windows builds (defaults .zip)
windows-archive = ".tar.gz" windows-archive = ".tar.gz"
# The archive format to use for non-windows builds (defaults .tar.xz) # The archive format to use for non-windows builds (defaults .tar.xz)
@@ -53,4 +58,4 @@ pr-run-mode = "plan"
# Whether to install an updater program # Whether to install an updater program
install-updater = true install-updater = true
allow-dirty = ["ci"] allow-dirty = ["ci"]

View File

@@ -1,10 +1,8 @@
use chrono::prelude::*;
use chrono::DateTime; use chrono::DateTime;
use clap::{Parser, Subcommand}; use clap::{Parser, Subcommand};
use std::fs; use std::fs;
use std::path::PathBuf; use std::path::PathBuf;
mod keys; mod keys;
mod pastebin; mod pastebin;
@@ -79,17 +77,33 @@ async fn list(max_results: Option<u16>) {
let line = "-".repeat(5); let line = "-".repeat(5);
println!("{}Top {} pastes{}", line, max_results.unwrap_or(10), line); println!("{}Top {} pastes{}", line, max_results.unwrap_or(10), line);
let mut max_length = 8;
let max = resp.iter().map(|paste| paste.paste_title.len()).max();
if max.is_some() {
if max.unwrap() > max_length {
max_length = max.unwrap();
}
}
for paste in resp { for paste in resp {
let mut title = paste.paste_title; let mut title = paste.paste_title;
if title == "" { if title == "" {
title = "Untitled".to_owned(); title = "Untitled".to_owned();
} }
let naive = NaiveDateTime::from_timestamp_opt(paste.paste_date.into(), 0).unwrap(); title = pad_string(&title, max_length);
let datetime: DateTime<Utc> = DateTime::from_utc(naive, Utc); let datetime = DateTime::from_timestamp(paste.paste_date.into(), 0).unwrap();
let newdate = datetime.format("%Y-%m-%d %H:%M:%S"); let formatted_date = datetime.format("%Y-%m-%d %H:%M:%S");
println!("{}\t{}\t{}", title, newdate, paste.paste_url); println!("{}\t{}\t{}", title, formatted_date, paste.paste_url);
} }
} }
fn pad_string(s: &str, length: usize) -> String {
let mut s = s.to_owned();
while s.len() < length {
s.push(' ');
}
s
}