1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-21 20:38:54 +00:00

Support parameters in PowerShell

Update the PowerShell alias so it passes thefuck parameters (e.g. `-y` or `-r`).
This commit is contained in:
Matt Kotsenas 2017-09-26 15:57:13 -07:00
parent e5255c3278
commit e6496ce8bb

View File

@ -6,7 +6,7 @@ class Powershell(Generic):
return 'function ' + alias_name + ' {\n' \
' $history = (Get-History -Count 1).CommandLine;\n' \
' if (-not [string]::IsNullOrWhiteSpace($history)) {\n' \
' $fuck = $(thefuck $history);\n' \
' $fuck = $(thefuck $args $history);\n' \
' if (-not [string]::IsNullOrWhiteSpace($fuck)) {\n' \
' if ($fuck.StartsWith("echo")) { $fuck = $fuck.Substring(5); }\n' \
' else { iex "$fuck"; }\n' \