summary refs log tree commit diff stats
diff options
context:
space:
mode:
-rw-r--r--ranger/api/commands.py19
1 files changed, 11 insertions, 8 deletions
diff --git a/ranger/api/commands.py b/ranger/api/commands.py
index 9d2e60e9..4ea6ad1c 100644
--- a/ranger/api/commands.py
+++ b/ranger/api/commands.py
@@ -294,12 +294,15 @@ class FunctionCommand(Command):
 			keywords['narg'] = self.quantifier
 
 		try:
-			return self._based_function(*args, **keywords)
-		except TypeError:
-			try:
-				del keywords['narg']
+			if self.quantifier is None:
 				return self._based_function(*args, **keywords)
-			except TypeError:
-				self.fm.notify("Bad arguments for %s.%s: %s, %s" %
-						(self._object_name, self._function_name,
-							repr(args), repr(keywords)), bad=True)
+			else:
+				try:
+					return self._based_function(*args, **keywords)
+				except TypeError:
+					del keywords['narg']
+					return self._based_function(*args, **keywords)
+		except TypeError:
+			self.fm.notify("Bad arguments for %s.%s: %s, %s" %
+					(self._object_name, self._function_name,
+						repr(args), repr(keywords)), bad=True)