mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-13 22:28:33 +00:00
#N/A Add ability to get Fish Shell history
This commit is contained in:
parent
465f6191b0
commit
4a7b335d7c
@ -180,6 +180,11 @@ class TestFish(object):
|
||||
assert 'thefuck' in shell.app_alias('fuck')
|
||||
assert 'TF_ALIAS' in shell.app_alias('fuck')
|
||||
|
||||
def test_get_history(self, history_lines, shell):
|
||||
history_lines(['- cmd: ls', ' when: 1432613911',
|
||||
'- cmd: rm', ' when: 1432613916'])
|
||||
assert list(shell.get_history()) == ['ls', 'rm']
|
||||
|
||||
|
||||
@pytest.mark.usefixtures('isfile')
|
||||
class TestZsh(object):
|
||||
|
@ -191,6 +191,12 @@ class Fish(Generic):
|
||||
def _get_history_line(self, command_script):
|
||||
return u'- cmd: {}\n when: {}\n'.format(command_script, int(time()))
|
||||
|
||||
def _script_from_history(self, line):
|
||||
if '- cmd: ' in line:
|
||||
return line.split('- cmd: ', 1)[1]
|
||||
else:
|
||||
return ''
|
||||
|
||||
def and_(self, *commands):
|
||||
return u'; and '.join(commands)
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user