From 538811e6677a73ac925b83bccf268af8ddab5aa0 Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Mon, 27 Jul 2015 16:46:43 +0200 Subject: Automatically create multipaste Signed-off-by: Florian Pritz --- fb.1 | 7 +++++-- fb.in | 4 ++++ 2 files changed, 9 insertions(+), 2 deletions(-) diff --git a/fb.1 b/fb.1 index 918ae84..e548502 100644 --- a/fb.1 +++ b/fb.1 @@ -28,7 +28,9 @@ is a client to https://paste.xinu.at which allows the user to easily upload, delete or download files. By default, files will be uploaded as-is and a link to the file will be printed -to stdout after each upload. +to stdout after each upload. If multiple files are uploaded a multipaste ( see +.Fl m +) will be created automatically. .Pp Directories will be packed into a tarball with .Xr tar 1 and the resulting @@ -88,7 +90,8 @@ Create a multipaste of the IDs/files/directories/URLs. This uploads files as always, but then creates a multipaste combining all of them. URLs starting with the pastebin URL will have their ID extracted and will not be downloaded. Only the multipaste URL will be copied to the clipboard, but all URLs will be -displayed while uploading. +displayed while uploading. This option is enabled automatically if multiple +files are uploaded. .It Fl h Display a short help message. .It Fl t diff --git a/fb.in b/fb.in index 69159de..9fe6392 100644 --- a/fb.in +++ b/fb.in @@ -347,6 +347,10 @@ done shift `expr $OPTIND - 1` +if [[ "$#" -gt 1 && ! "$tar" ]]; then + multipaste=1 +fi + if [ "$compress" = "1" ]; then require_executable gzip elif [ "$compress" = "2" ]; then -- cgit v1.2.3-24-g4f1b