summary refs log tree commit diff stats
path: root/ranger
diff options
context:
space:
mode:
authorhut <hut@lavabit.com>2012-02-12 17:12:28 +0100
committerhut <hut@lavabit.com>2012-02-12 17:12:28 +0100
commite748d5056c907c5f9e46f6824442d47231a1ad32 (patch)
tree7bae98c00cdf3a9ca46096b0845e37fc87692a32 /ranger
parenta0cff8b77b3a81c84661e96a1efdd5bd5d6e6eac (diff)
downloadranger-e748d5056c907c5f9e46f6824442d47231a1ad32.tar.gz
core.main: Allow multiple --cmd's, add man page entry for --cmd
Diffstat (limited to 'ranger')
-rw-r--r--ranger/core/helper.py5
-rw-r--r--ranger/core/main.py3
2 files changed, 5 insertions, 3 deletions
diff --git a/ranger/core/helper.py b/ranger/core/helper.py
index 3f93e79c..c556b9bd 100644
--- a/ranger/core/helper.py
+++ b/ranger/core/helper.py
@@ -73,8 +73,9 @@ def parse_arguments():
 			help="List all files which are tagged with the given tag, default: *")
 	parser.add_option('--profile', action='store_true',
 			help="Print statistics of CPU usage on exit.")
-	parser.add_option('--cmd', type='string', metavar='COMMAND',
-			help="COMMAND will be executed after ranger has initialized")
+	parser.add_option('--cmd', action='append', type='string', metavar='COMMAND',
+			help="Execute COMMAND after the configuration has been read. "
+			"Use this option multiple times to run multiple commands.")
 
 	options, positional = parser.parse_args()
 	arg = OpenStruct(options.__dict__, targets=positional)
diff --git a/ranger/core/main.py b/ranger/core/main.py
index f80ee2d6..a17c6863 100644
--- a/ranger/core/main.py
+++ b/ranger/core/main.py
@@ -123,7 +123,8 @@ def main():
 		fm.ui.initialize()
 
 		if arg.cmd:
-			fm.execute_console(arg.cmd)
+			for command in arg.cmd:
+				fm.execute_console(command)
 
 		if ranger.arg.profile:
 			import cProfile