]> arthur.barton.de Git - bup.git/blobdiff - lib/cmd/ftp-cmd.py
web: convert to internal command
[bup.git] / lib / cmd / ftp-cmd.py
index 02a6fecef014609806e827c0c3a0b7aa222a6c1e..2878c8b6954bef56bd3d67a65ec2a837fe90cc30 100755 (executable)
@@ -20,9 +20,12 @@ exec "$bup_python" "$0"
 # (e.g. ISO-8859-1).
 
 from __future__ import absolute_import, print_function
-import os, fnmatch, stat, sys
 
-sys.path[:0] = [os.path.dirname(os.path.realpath(__file__)) + '/..']
+# Intentionally replace the dirname "$0" that python prepends
+import os, sys
+sys.path[0] = os.path.dirname(os.path.realpath(__file__)) + '/..'
+
+import fnmatch, stat
 
 from bup import _helpers, compat, options, git, shquote, ls, vfs
 from bup.compat import argv_bytes, fsdecode
@@ -39,8 +42,7 @@ class OptionError(Exception):
 
 def do_ls(repo, args, out):
     try:
-        opt = ls.opts_from_cmdline([fsdecode(arg) for arg in args],
-                                   onabort=OptionError)
+        opt = ls.opts_from_cmdline(args, onabort=OptionError)
     except OptionError as e:
         log('error: %s' % e)
         return