(self, line)
return line
Handle alias expansion and ';;' separator.
Handle alias expansion and ';;' separator.
Handle alias expansion and ;; separator .
def precmd(self, line):
        """Handle alias expansion and ';;' separator."""
        if not line.strip():
            return line
        args = line.split()
        while args[0] in self.aliases:
            line = self.aliases[args[0]]
            ii = 1
            for tmpArg in args[1:]:
                line = line.replace("%" + str(ii),
                                      tmpArg)
                ii += 1
            line = line.replace("%*", ' '.join(args[1:]))
            args = line.split()
        # split into ';;' separated commands
        # unless it's an alias command
        if args[0] != 'alias':
            marker = line.find(';;')
            if marker >= 0:
                # queue up everything after marker
                next = line[marker+2:].lstrip()
                self.cmdqueue.append(next)
                line = line[:marker].rstrip()
        return line
def precmd ( self , line ) : if not line . strip ( ) : return line args = line . split ( ) while args [ 0 ] in self . aliases : line = self . aliases [ args [ 0 ] ] ii = 1 for tmpArg in args [ 1 : ] : line = line . replace ( "%" + str ( ii ) , tmpArg ) ii += 1 line = line . replace ( "%*" , ' ' . join ( args [ 1 : ] ) ) args = line . split ( ) # split into ';;' separated commands # unless it's an alias command if args [ 0 ] != 'alias' : marker = line . find ( ';;' ) if marker >= 0 : # queue up everything after marker next = line [ marker + 2 : ] . lstrip ( ) self . cmdqueue . append ( next ) line = line [ : marker ] . rstrip ( ) return line