summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xinu.at>2016-02-13 14:39:57 +0100
committerFlorian Pritz <bluewind@xinu.at>2016-02-13 14:39:57 +0100
commita906a4e17453663091a24d63582936030e3e0edb (patch)
tree2101c00051aeb79386b6cb3e60a55ed1d08622a8
parentb2cc4200359e94da78d7dbd2b9c9bc2d5b158a91 (diff)
Add --id option to create multipaste from IDs
Signed-off-by: Florian Pritz <bluewind@xinu.at>
-rwxr-xr-xfb.py6
1 files changed, 6 insertions, 0 deletions
diff --git a/fb.py b/fb.py
index 82c4b7e..362b8c3 100755
--- a/fb.py
+++ b/fb.py
@@ -426,6 +426,8 @@ class FBClient:
help="Enable debug output")
upload_options = parser.add_argument_group('upload options')
+ upload_options.add_argument("-i", "--id", default=False, action="store_true",
+ help="Interpret arguments as IDs")
upload_options.add_argument("-t", "--tar", default=False, action="store_true",
help="Upload a tar file containing all files (and directories)")
upload_options.add_argument("-m", "--multipaste", default=False, action="store_true",
@@ -598,6 +600,10 @@ class FBClient:
self.upload_files([tempfile])
return
else:
+ if self.args.id:
+ ids = [self.extractId(arg) for arg in self.args.args]
+ return self.multipaste(ids)
+
# TODO: detect paste URLs and add their IDs to a multipaste
files = [self.dl_file(arg) for arg in self.args.args]
self.upload_files(files)