summaryrefslogtreecommitdiffstats
path: root/fb
diff options
context:
space:
mode:
authorFlorian Pritz <bluewind@xssn.at>2009-09-02 19:21:41 +0200
committerFlorian Pritz <bluewind@xssn.at>2009-09-02 19:21:41 +0200
commit7fc769e425858bee31d08308ba3c5a522c71b157 (patch)
tree14d5f505822c7b218ae3a0210664cf41af66b28a /fb
parent4a6730b7032199229c93fb25fb857c00977676a1 (diff)
downloadbin-7fc769e425858bee31d08308ba3c5a522c71b157.tar.gz
bin-7fc769e425858bee31d08308ba3c5a522c71b157.tar.xz
fb: require -d only once per execution
Signed-off-by: Florian Pritz <bluewind@xssn.at>
Diffstat (limited to 'fb')
-rwxr-xr-xfb13
1 files changed, 6 insertions, 7 deletions
diff --git a/fb b/fb
index 1fd5c34..67292e2 100755
--- a/fb
+++ b/fb
@@ -82,18 +82,17 @@ def main():
p = OptionParser(version=__version__,
usage=__doc__,
description=__desc__+password.__doc__)
- p.add_option('-d', '--delete', action='append', dest='delete',
- help='delete file by ID', metavar='<ID>', default=None)
+ p.add_option('-d', '--delete', action='store_true', dest='delete',
+ help='delete IDs', default=False)
options, args = p.parse_args()
- if options.delete:
- for id in options.delete:
- delete(id)
- sys.exit()
-
tmpfiles = []
if args:
for arg in args:
+ if options.delete:
+ delete(arg)
+ continue
+
if arg.find('http://') != -1:
tmpdir = Popen(['mktemp', '-d'], stdout=PIPE).communicate()[0]
tmpdir = tmpdir.replace('\n', '')