mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +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'
|
' env TF_SHELL=fish TF_ALIAS={0} PYTHONIOENCODING=utf-8'
|
||||||
' thefuck $fucked_up_command {2} $argv | read -l unfucked_command\n'
|
' thefuck $fucked_up_command {2} $argv | read -l unfucked_command\n'
|
||||||
' if [ "$unfucked_command" != "" ]\n'
|
' if [ "$unfucked_command" != "" ]\n'
|
||||||
' commandline $unfucked_command\n'
|
' eval $unfucked_command\n{1}'
|
||||||
' commandline -f execute\n{1}'
|
|
||||||
' end\n'
|
' end\n'
|
||||||
'end').format(alias_name, alter_history, ARGUMENT_PLACEHOLDER)
|
'end').format(alias_name, alter_history, ARGUMENT_PLACEHOLDER)
|
||||||
|
|
||||||
@ -127,3 +126,7 @@ class Fish(Generic):
|
|||||||
history.write(entry.encode('utf-8'))
|
history.write(entry.encode('utf-8'))
|
||||||
else:
|
else:
|
||||||
history.write(entry)
|
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,
|
path=path,
|
||||||
reload=reload,
|
reload=reload,
|
||||||
can_configure_automatically=Path(path).expanduser().exists())
|
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 '',
|
'--debug ' if settings.debug else '',
|
||||||
shell.quote(self.script))
|
shell.quote(self.script))
|
||||||
return shell.or_(self.script, repeat_fuck)
|
return shell.or_(self.script, repeat_fuck)
|
||||||
else:
|
|
||||||
return self.script
|
return shell.commandline_wrap(self.script)
|
||||||
|
|
||||||
def run(self, old_cmd):
|
def run(self, old_cmd):
|
||||||
"""Runs command from rule for passed command.
|
"""Runs command from rule for passed command.
|
||||||
|
Loading…
x
Reference in New Issue
Block a user