From a906a4e17453663091a24d63582936030e3e0edb Mon Sep 17 00:00:00 2001 From: Florian Pritz Date: Sat, 13 Feb 2016 14:39:57 +0100 Subject: Add --id option to create multipaste from IDs Signed-off-by: Florian Pritz --- fb.py | 6 ++++++ 1 file changed, 6 insertions(+) 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) -- cgit v1.2.3-24-g4f1b