about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authornfnty <git@nfnty.se>2017-03-18 18:44:06 +0100
committernfnty <git@nfnty.se>2017-03-18 18:46:03 +0100
commiteb4d9d5424ee31ae911876213b7d483f8a90d451 (patch)
treea620b24471f3780bbaf1707368138e200fcb4316
parenta05a5b43bdc652aba2b4a0fe84f950328a70b043 (diff)
downloadranger-eb4d9d5424ee31ae911876213b7d483f8a90d451.tar.gz
core.main: Add support for `file://` URIs as path arguments
Fixes #836
-rw-r--r--ranger/core/main.py5
1 files changed, 4 insertions, 1 deletions
diff --git a/ranger/core/main.py b/ranger/core/main.py
index b44f75c8..b7ad4617 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -90,7 +90,10 @@ def main(
         args.selectfile = os.path.abspath(args.selectfile)
         args.paths.insert(0, os.path.dirname(args.selectfile))
 
-    paths = args.paths or [os.environ.get('PWD', os.getcwd())]
+    if args.paths:
+        paths = [p[7:] if p.startswith('file:///') else p for p in args.paths]
+    else:
+        paths = [os.environ.get('PWD', os.getcwd())]
     paths_inaccessible = []
     for path in paths:
         try: