'Implements the tunnel command'

def func(self):

    if ((not self.args) or (not self.lhs)):
        string = 'Usage:    @tunnel[/switch]    <direction>    [=    <roomname>[;alias;alias;...][:typeclass]]'
        self.caller.msg(string)
        return
    if (self.lhs not in self.directions):
        string = ('@tunnel    can    only    understand    the    following    directions:    %s.' % ','.join(sorted(self.directions.keys())))
        string += '\n(use    @dig    for    more    freedom)'
        self.caller.msg(string)
        return
    exitshort = self.lhs
    (exitname, backshort) = self.directions[exitshort]
    backname = self.directions[backshort][0]
    roomname = 'Some    place'
    if self.rhs:
        roomname = self.rhs
    telswitch = ''
    if ('tel' in self.switches):
        telswitch = '/teleport'
    backstring = ''
    if (not ('oneway' in self.switches)):
        backstring = (',    %s;%s' % (backname, backshort))
    digstring = ('@dig%s    %s    =    %s;%s%s' % (telswitch, roomname, exitname, exitshort, backstring))
    self.execute_cmd(digstring)
