diff options
-rw-r--r-- | ranger/core/helper.py | 2 | ||||
-rw-r--r-- | ranger/core/main.py | 4 |
2 files changed, 6 insertions, 0 deletions
diff --git a/ranger/core/helper.py b/ranger/core/helper.py index 446d9328..3f93e79c 100644 --- a/ranger/core/helper.py +++ b/ranger/core/helper.py @@ -73,6 +73,8 @@ 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") options, positional = parser.parse_args() arg = OpenStruct(options.__dict__, targets=positional) diff --git a/ranger/core/main.py b/ranger/core/main.py index 8458f928..f80ee2d6 100644 --- a/ranger/core/main.py +++ b/ranger/core/main.py @@ -121,6 +121,10 @@ def main(): # Run the file manager fm.initialize() fm.ui.initialize() + + if arg.cmd: + fm.execute_console(arg.cmd) + if ranger.arg.profile: import cProfile import pstats |