summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--fb.112
-rwxr-xr-xfb.py8
2 files changed, 15 insertions, 5 deletions
diff --git a/fb.1 b/fb.1
index 45ae3f2..24fceb4 100644
--- a/fb.1
+++ b/fb.1
@@ -1,10 +1,10 @@
-.\" Copyright (c) 2010-2014 Florian Pritz, bluewind at xinu.at
+.\" Copyright (c) 2010-2016 Florian Pritz, bluewind at xinu.at
.\" 2011 Moritz Wilhelmy, mw at wzff.de
.\"
.\" Licensed under GPLv3
.\" (see COPYING for full license text)
.\"
-.Dd September 18, 2015
+.Dd April 11, 2016
.Dt FB 1
.Os
@@ -15,11 +15,11 @@
.Sh SYNOPSIS
.Nm
.Op options
-.Ar file/directory ...
+.Ar file|directory|id://ID|URL ...
.Nm
.Op Fl dg
.Op options
-.Ar ID/URL ...
+.Ar ID|URL ...
.Nm
.Op Fl hv
@@ -52,6 +52,8 @@ is installed.
If you want to use paste.xinu.at, you need to create an account there and then run
.Sq Nm Fl a
to create an API key.
+.Pp
+IDs of existing pastes can either be given as URLs pointing to that paste or by prefixing the ID with "id://".
.Sh OPTIONS
.Bl -tag -width Ds
@@ -87,7 +89,7 @@ binary data may cause unexpected results when being output directly to a
terminal. You can no longer upload files in this mode. If the argument is a
URL,
.Nm
-will try to extract the ID.
+will try to extract the ID. This option also accepts IDs without the "id://" prefix.
.It Fl m, -multipaste
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
diff --git a/fb.py b/fb.py
index 7c6f7e2..5e6611d 100755
--- a/fb.py
+++ b/fb.py
@@ -97,6 +97,14 @@ class CURLWrapper:
return self.serverConfig
def upload_files(self, files):
+ """
+ Upload files if f.should_upload() for f in files is true.
+
+ Args:
+ files: List of File objects
+ Returns:
+ List of updated File objects
+ """
totalSize = 0
chunks = [[]]
currentChunkSize = 0