Add command line tool to submit pastes #11

Closed
opened 2019-11-08 13:41:36 +01:00 by minnozz · 4 comments
Collaborator

This would make it easier to quickly submit a paste if you're a terminal user.

This would make it easier to quickly submit a paste if you're a terminal user.
Collaborator

I use this snippet in my `.bashrc:

pbu() {
    echo "================================" | tee -a ~/.hashru-pastes
    echo "Shortening ${1}..." | tee -a ~/.hashru-pastes
    curl -sSF "shorten=${1}" -F 'deleteToken=' https://hashru.link/ | tee -a ~/.hashru-pastes
}

Would that work for you, or do you prefer a simple binary?

I use this snippet in my `.bashrc: ``` pbu() { echo "================================" | tee -a ~/.hashru-pastes echo "Shortening ${1}..." | tee -a ~/.hashru-pastes curl -sSF "shorten=${1}" -F 'deleteToken=' https://hashru.link/ | tee -a ~/.hashru-pastes } ``` Would that work for you, or do you prefer a simple binary?
Owner

We can actually ship an "official" shell script "binary". ^^

We can actually ship an "official" shell script "binary". ^^
electricdusk added the
feature
label 2019-12-15 12:38:38 +01:00
minnozz changed title from Add command line binary to submit pastes to Add command line tool to submit pastes 2019-12-16 09:49:42 +01:00
Author
Collaborator

A shell script like that would be perfectly fine. I also like that a log of your own pastes is kept (especially when delete tokens are generated/returned by the server).

Maybe two separate scripts for pasting and shortening would be easier to use?

A shell script like that would be perfectly fine. I also like that a log of your own pastes is kept (especially when delete tokens are generated/returned by the server). Maybe two separate scripts for pasting and shortening would be easier to use?
Collaborator

#39 adds a tool that handles link shortening, file uploading, and deleting:

$ rushlink --help
rushlink - Command line tool for https://hashru.link/

Usage:
    rushlink https://example.com/
        Shorten link.
    rushlink file.txt
    rushlink < file.txt
        Upload file.
    rushlink
    echo hi | rushlink
        Upload file from standard input.
    rushlink (--delete|-d) https://hashru.link/xd42
    rushlink (--delete|-d) xd42
        Delete file or shortened link.

Delete tokens are stored in ~/.local/share/rushlink/delete
#39 adds a tool that handles link shortening, file uploading, and deleting: ```text $ rushlink --help rushlink - Command line tool for https://hashru.link/ Usage: rushlink https://example.com/ Shorten link. rushlink file.txt rushlink < file.txt Upload file. rushlink echo hi | rushlink Upload file from standard input. rushlink (--delete|-d) https://hashru.link/xd42 rushlink (--delete|-d) xd42 Delete file or shortened link. Delete tokens are stored in ~/.local/share/rushlink/delete ```
Sign in to join this conversation.
No Milestone
No Assignees
4 Participants
Notifications
Due Date
The due date is invalid or out of range. Please use the format 'yyyy-mm-dd'.

No due date set.

Dependencies

No dependencies set.

Reference: electricdusk/rushlink#11
No description provided.