Skip to content

Commit 40ab4eb

Browse files
scorphusnvbn
authored andcommitted
#899: Support -y/--yeah command line args in Fish Shell (#900)
1 parent 55cb354 commit 40ab4eb

File tree

2 files changed

+5
-2
lines changed

2 files changed

+5
-2
lines changed

tests/shells/test_fish.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,7 @@
11
# -*- coding: utf-8 -*-
22

33
import pytest
4+
from thefuck.const import ARGUMENT_PLACEHOLDER
45
from thefuck.shells import Fish
56

67

@@ -82,6 +83,7 @@ def test_app_alias(self, shell):
8283
assert 'TF_SHELL=fish' in shell.app_alias('fuck')
8384
assert 'TF_ALIAS=fuck PYTHONIOENCODING' in shell.app_alias('fuck')
8485
assert 'PYTHONIOENCODING=utf-8 thefuck' in shell.app_alias('fuck')
86+
assert ARGUMENT_PLACEHOLDER in shell.app_alias('fuck')
8587

8688
def test_app_alias_alter_history(self, settings, shell):
8789
settings.alter_history = True

thefuck/shells/fish.py

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -5,6 +5,7 @@
55
import six
66
from .. import logs
77
from ..conf import settings
8+
from ..const import ARGUMENT_PLACEHOLDER
89
from ..utils import DEVNULL, cache
910
from .generic import Generic
1011

@@ -56,11 +57,11 @@ def app_alias(self, alias_name):
5657
return ('function {0} -d "Correct your previous console command"\n'
5758
' set -l fucked_up_command $history[1]\n'
5859
' env TF_SHELL=fish TF_ALIAS={0} PYTHONIOENCODING=utf-8'
59-
' thefuck $fucked_up_command | read -l unfucked_command\n'
60+
' thefuck $fucked_up_command {2} $argv | read -l unfucked_command\n'
6061
' if [ "$unfucked_command" != "" ]\n'
6162
' eval $unfucked_command\n{1}'
6263
' end\n'
63-
'end').format(alias_name, alter_history)
64+
'end').format(alias_name, alter_history, ARGUMENT_PLACEHOLDER)
6465

6566
def get_aliases(self):
6667
overridden = self._get_overridden_aliases()

0 commit comments

Comments
 (0)