mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-14 06:38:32 +00:00
#1028: Move commandline
instructions into shell
This commit is contained in:
parent
929d732332
commit
3cb2821884
@ -60,8 +60,7 @@ class Fish(Generic):
|
||||
' env TF_SHELL=fish TF_ALIAS={0} PYTHONIOENCODING=utf-8'
|
||||
' thefuck $fucked_up_command {2} $argv | read -l unfucked_command\n'
|
||||
' if [ "$unfucked_command" != "" ]\n'
|
||||
' commandline $unfucked_command\n'
|
||||
' commandline -f execute\n{1}'
|
||||
' eval $unfucked_command\n{1}'
|
||||
' end\n'
|
||||
'end').format(alias_name, alter_history, ARGUMENT_PLACEHOLDER)
|
||||
|
||||
@ -127,3 +126,7 @@ class Fish(Generic):
|
||||
history.write(entry.encode('utf-8'))
|
||||
else:
|
||||
history.write(entry)
|
||||
|
||||
def commandline_wrap(self, command):
|
||||
"""Return the commandline replace and execute commands"""
|
||||
return u'commandline "{}"; commandline -f execute'.format(command)
|
||||
|
@ -152,3 +152,7 @@ class Generic(object):
|
||||
path=path,
|
||||
reload=reload,
|
||||
can_configure_automatically=Path(path).expanduser().exists())
|
||||
|
||||
def commandline_wrap(self, command):
|
||||
"""Generic implementation of commandline wrapper"""
|
||||
return command
|
||||
|
@ -238,8 +238,8 @@ class CorrectedCommand(object):
|
||||
'--debug ' if settings.debug else '',
|
||||
shell.quote(self.script))
|
||||
return shell.or_(self.script, repeat_fuck)
|
||||
else:
|
||||
return self.script
|
||||
|
||||
return shell.commandline_wrap(self.script)
|
||||
|
||||
def run(self, old_cmd):
|
||||
"""Runs command from rule for passed command.
|
||||
|
Loading…
x
Reference in New Issue
Block a user