code: def action(self, *action_names):
          
          def action_wrapper(decorated):
  
              @functools.wraps(decorated)
              def wrapper(argv):
                  kwargs = dict(arg.split('=') for arg in argv)
                  try:
                      return decorated(**kwargs)
                  except TypeError as e:
                      if decorated.__doc__:
                          e.args += (decorated.__doc__,)
                      raise
  
              self.register_action(decorated.__name__, wrapper)
              if '_' in decorated.__name__:
                  self.register_action(
                      decorated.__name__.replace('_', '-'), wrapper)
  
              return wrapper
  
          return action_wrapper
docs: Decorator, registering them as actions