From 16c110823db8159cb91392f00e206d90f1d96b0c Mon Sep 17 00:00:00 2001 From: Matt Kotsenas Date: Mon, 27 Jun 2016 13:29:24 -0400 Subject: [PATCH] Add semi-colons in powershell alias Add semi-colons in powershell alias so that if line breaks get lost the function can still be invoked directly. This makes it possible to add thefuck to the current session by running iex "$(thefuck --alias)" which mirrors the eval syntax in bash --- thefuck/shells/powershell.py | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/thefuck/shells/powershell.py b/thefuck/shells/powershell.py index fd0095ff..160a05c4 100644 --- a/thefuck/shells/powershell.py +++ b/thefuck/shells/powershell.py @@ -4,10 +4,10 @@ from .generic import Generic class Powershell(Generic): def app_alias(self, fuck): return 'function ' + fuck + ' { \n' \ - ' $fuck = $(thefuck (Get-History -Count 1).CommandLine)\n' \ + ' $fuck = $(thefuck (Get-History -Count 1).CommandLine);\n' \ ' if (-not [string]::IsNullOrWhiteSpace($fuck)) {\n' \ - ' if ($fuck.StartsWith("echo")) { $fuck = $fuck.Substring(5) }\n' \ - ' else { iex "$fuck" }\n' \ + ' if ($fuck.StartsWith("echo")) { $fuck = $fuck.Substring(5); }\n' \ + ' else { iex "$fuck"; }\n' \ ' }\n' \ '}\n'