       name: name
     }
 
-  # a bit of black magic ;)
+  # creates a function as a prototype of `context'.
+  # can be used to mass-produce class methods
   `function _makeFun(context, name, cb) {
     context.prototype[name] = cb;
     return context;

        return false

  _makeOpt: (name) ->
    _op = name.replace(/^.*?([:]*)$/, '$1')
    name = name.replace(/^(.*?)[:]*$/, '$1')
    if _op is '::'
      op = 'optarg'
    else if op is ':'
      op = 'arg'
    else
      op = 'flag'

  [ 'shortBeat', 'longBeat' ].forEach((funcName) =>
    listName = funcName.replace(/Beat/, '')
    return _makeFun(@, funcName, (_name, fn) ->
      self = @
      # determine the type of OPTION, based on the OPTION's name
      { op, name } = self._makeOpt(_name)
      self._beatError(listName, name)

      if fn is undefined
        self._parent.type ?= op
        child = clone(self._parent)
        # give child a pointer to its parent
        child.parent = self._parent
        child.parent.index = child.index

        ++child.index # increment child.index again to set it to its own index
        child.name = name
        child.list = listName
        # give parent a pointer to its child
        self._parent.child = child
        self._options.push(child)
      else
        option =
          cb: fn
          type: op
          name: name
          list: listName
          child: null
          parent: null
        self._options.push(option)
        index = self._options.length - 1
        option = self._options.pop()
        option.index = index
        self._options.push(option)
      self._parent = self._options.slice(-1)[0]
      return self))

  help: (text) =>
