summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2010-06-24 00:16:01 +0200
committerhut <hut@lavabit.com>2010-06-24 00:18:34 +0200
commit1621a40c0e268929fff97c79537db709dd2b3fc6 (patch)
tree8a268ae3fa440ecc29718608f477d70493a80677
parent3817c8b47e85d3644383182c2b3909a2dbdd0b3b (diff)
downloadranger-1621a40c0e268929fff97c79537db709dd2b3fc6.tar.gz
ranger.main: ranger dir1 dir2 [...] opens multiple tabs
-rw-r--r--ranger/__main__.py13
1 files changed, 6 insertions, 7 deletions
diff --git a/ranger/__main__.py b/ranger/__main__.py
index ac6b2362..b3a41776 100644
--- a/ranger/__main__.py
+++ b/ranger/__main__.py
@@ -22,7 +22,7 @@
 # convenient exception handling in ranger.py (ImportError)
 
 import locale
-import os
+import os.path
 import sys
 
 def parse_arguments():
@@ -181,8 +181,9 @@ def main():
 
 	SettingsAware._setup()
 
+	targets = arg.targets or ['.']
+	target = targets[0]
 	if arg.targets:
-		target = arg.targets[0]
 		if target.startswith('file://'):
 			target = target[7:]
 		if not os.access(target, os.F_OK):
@@ -195,16 +196,14 @@ def main():
 			load_apps(runner, ranger.arg.clean)
 			runner(files=[File(target)], mode=arg.mode, flags=arg.flags)
 			sys.exit(1 if arg.fail_unless_cd else 0)
-		else:
-			path = target
-	else:
-		path = '.'
 
 	crash_traceback = None
 	try:
 		# Initialize objects
-		EnvironmentAware._assign(Environment(path))
+		EnvironmentAware._assign(Environment(target))
 		fm = FM()
+		fm.tabs = dict((n+1, os.path.abspath(path)) for n, path \
+				in enumerate(targets[:9]))
 		load_settings(fm, ranger.arg.clean)
 		FileManagerAware._assign(fm)
 		fm.ui = UI()