Correct "overriden" typos.
[nivanova/samba-autobuild/.git] / python / samba / netcmd / __init__.py
index a3edf50516567527a6fb226357b463e9f97ca285..ad8143de856f074bc45fc50aefa4b7e53fba99a6 100644 (file)
@@ -120,7 +120,7 @@ class Command(object):
             force_traceback = True
 
         if force_traceback or samba.get_debug_level() >= 3:
-            traceback.print_tb(etraceback)
+            traceback.print_tb(etraceback, file=self.errf)
 
     def _create_parser(self, prog, epilog=None):
         parser = optparse.OptionParser(
@@ -153,13 +153,14 @@ class Command(object):
         # Check for a min a max number of allowed arguments, whenever possible
         # The suffix "?" means zero or one occurence
         # The suffix "+" means at least one occurence
+        # The suffix "*" means zero or more occurences
         min_args = 0
         max_args = 0
         undetermined_max_args = False
         for i, arg in enumerate(self.takes_args):
-            if arg[-1] != "?":
+            if arg[-1] != "?" and arg[-1] != "*":
                min_args += 1
-            if arg[-1] == "+":
+            if arg[-1] == "+" or arg[-1] == "*":
                undetermined_max_args = True
             else:
                max_args += 1
@@ -178,7 +179,7 @@ class Command(object):
             return -1
 
     def run(self):
-        """Run the command. This should be overriden by all subclasses."""
+        """Run the command. This should be overridden by all subclasses."""
         raise NotImplementedError(self.run)
 
     def get_logger(self, name="netcmd"):