diff options
author | Florian Pritz <bluewind@xssn.at> | 2009-09-02 19:21:41 +0200 |
---|---|---|
committer | Florian Pritz <bluewind@xssn.at> | 2009-09-02 19:21:41 +0200 |
commit | 7fc769e425858bee31d08308ba3c5a522c71b157 (patch) | |
tree | 14d5f505822c7b218ae3a0210664cf41af66b28a /fb | |
parent | 4a6730b7032199229c93fb25fb857c00977676a1 (diff) | |
download | bin-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-x | fb | 13 |
1 files changed, 6 insertions, 7 deletions
@@ -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', '') |