refact(shells): add and_ method to assemble expressions involving AND

Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
This commit is contained in:
Pablo Santiago Blum de Aguiar
2015-05-12 21:13:51 -03:00
parent d854320acc
commit 3d0d4be4a9
10 changed files with 37 additions and 7 deletions
+3 -1
View File
@@ -1,4 +1,5 @@
import subprocess
from thefuck import shells
from thefuck.utils import DEVNULL
@@ -30,7 +31,8 @@ def match(command, settings):
def get_new_command(command, settings):
package = __get_pkgfile(command)[0]
return '{} -S {} && {}'.format(pacman, package, command.script)
formatme = shells.and_('{} -S {}', '{}')
return formatme.format(pacman, package, command.script)
if not __command_available('pkgfile'):