about summary refs log tree commit diff stats
diff options
context:
space:
mode:
authorWojciech Siewierski <wojciech@siewierski.eu>2020-07-05 13:23:40 +0200
committerGitHub <noreply@github.com>2020-07-05 13:23:40 +0200
commit617b736b35f09878039f49c79b517a844d405841 (patch)
treed26e97c8b53a5aa02de321110d626cf27ffa209b
parent4bb83b37819f5085596a6cd82a5010d5560a5db4 (diff)
parent2eedfe69007afac6150ddbdd47aa8ac67774d56f (diff)
downloadranger-617b736b35f09878039f49c79b517a844d405841.tar.gz
Merge pull request #2013 from toonn/silence-bulkrename
Implement passing of flags for :bulkrename
-rwxr-xr-xranger/config/commands.py8
1 files changed, 7 insertions, 1 deletions
diff --git a/ranger/config/commands.py b/ranger/config/commands.py
index 5defa677..e3b3fa82 100755
--- a/ranger/config/commands.py
+++ b/ranger/config/commands.py
@@ -1124,6 +1124,12 @@ class bulkrename(Command):
     After you close it, it will be executed.
     """
 
+    def __init__(self, *args, **kwargs):
+        super(bulkrename, self).__init__(*args, **kwargs)
+        self.flags, _ = self.parse_flags()
+        if not self.flags:
+            self.flags = "w"
+
     def execute(self):
         # pylint: disable=too-many-locals,too-many-statements,too-many-branches
         import sys
@@ -1184,7 +1190,7 @@ class bulkrename(Command):
             script_was_edited = (script_content != cmdfile.read())
 
             # Do the renaming
-            self.fm.run(['/bin/sh', cmdfile.name], flags='w')
+            self.fm.run(['/bin/sh', cmdfile.name], flags=self.flags)
 
         # Retag the files, but only if the script wasn't changed during review,
         # because only then we know which are the source and destination files.