From 09e1742bcc3c4c06a92b6292370ce3e6d8b4a341 Mon Sep 17 00:00:00 2001
From: Alexander Cherniuk <ts33kr@gmail.com>
Date: Thu, 5 Aug 2010 14:06:36 +0300
Subject: [PATCH] Shortened a couple of things in the command system

---
 src/command_system/framework.py               | 24 +++++++++----------
 src/command_system/implementation/standard.py |  2 +-
 src/command_system/mapping.py                 |  2 +-
 3 files changed, 14 insertions(+), 14 deletions(-)

diff --git a/src/command_system/framework.py b/src/command_system/framework.py
index cb4aaad65c..2a6c7d7a82 100644
--- a/src/command_system/framework.py
+++ b/src/command_system/framework.py
@@ -226,9 +226,9 @@ def command(*names, **properties):
     can be reached. If no names are given - the the native name (the one
     extracted from the command handler) will be used.
 
-    If include_native=True is given (default) and names is non-empty -
-    then the native name of the command will be prepended in addition to
-    the given names.
+    If native=True is given (default) and names is non-empty - then the
+    native name of the command will be prepended in addition to the
+    given names.
 
     If usage=True is given (default) - then command help will be
     appended with autogenerated usage info, based of the command handler
@@ -256,14 +256,14 @@ def command(*names, **properties):
     If overlap=True is given - then all the extra arguments will be
     mapped as if they were values for the keyword arguments.
 
-    If expand_short=True is given (default) - then short, one-letter
-    options will be expanded to a verbose ones, based of the comparison
-    of the first letter. If more then one option with the same first
-    letter is given - then only first one will be used in the expansion.
+    If expand=True is given (default) - then short, one-letter options
+    will be expanded to a verbose ones, based of the comparison of the
+    first letter. If more then one option with the same first letter is
+    given - then only first one will be used in the expansion.
     """
     names = list(names)
 
-    include_native = properties.get('include_native', True)
+    native = properties.get('native', True)
 
     usage = properties.get('usage', True)
     source = properties.get('source', False)
@@ -271,7 +271,7 @@ def command(*names, **properties):
     empty = properties.get('empty', False)
     extra = properties.get('extra', False)
     overlap = properties.get('overlap', False)
-    expand_short = properties.get('expand_short', True)
+    expand = properties.get('expand', True)
 
     if empty and not raw:
         raise DefinitionError("Empty option can be used only with raw commands")
@@ -286,7 +286,7 @@ def command(*names, **properties):
         'extra': extra,
         'overlap': overlap,
         'empty': empty,
-        'expand_short': expand_short
+        'expand': expand
     }
 
     def decorator(handler):
@@ -297,9 +297,9 @@ def command(*names, **properties):
         command = Command(handler, *names, **properties)
 
         # Extract and inject a native name if either no other names are
-        # specified or include_native property is enabled, while making
+        # specified or native property is enabled, while making
         # sure it is going to be the first one in the list.
-        if not names or include_native:
+        if not names or native:
             names.insert(0, command.native_name)
             command.names = tuple(names)
 
diff --git a/src/command_system/implementation/standard.py b/src/command_system/implementation/standard.py
index bcc2d684c9..05fa08dc2f 100644
--- a/src/command_system/implementation/standard.py
+++ b/src/command_system/implementation/standard.py
@@ -57,7 +57,7 @@ class StandardCommonCommands(CommandContainer):
         self.chat_buttons_set_visible(new_status)
 
     @command(overlap=True)
-    @doc(_("Show help on a given command or a list of available commands if -(-a)ll is given"))
+    @doc(_("Show help on a given command or a list of available commands if -a is given"))
     def help(self, command=None, all=False):
         if command:
             command = self.get_command(command)
diff --git a/src/command_system/mapping.py b/src/command_system/mapping.py
index 8f7a31470c..c8ae3a430e 100644
--- a/src/command_system/mapping.py
+++ b/src/command_system/mapping.py
@@ -205,7 +205,7 @@ def adapt_arguments(command, arguments, args, opts):
     # The second stage of transforming options to an associatable state.
     # Expanding short, one-letter options to a verbose ones, if
     # corresponding optin has been given.
-    if command.expand_short:
+    if command.expand:
         expanded = []
         for spec_key, spec_value in norm_kwargs.iteritems():
             letter = spec_key[0] if len(spec_key) > 1 else None
-- 
GitLab