mirror of
https://github.com/nvbn/thefuck.git
synced 2025-02-22 12:58:33 +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:
parent
e5255c3278
commit
e6496ce8bb
@ -6,7 +6,7 @@ class Powershell(Generic):
|
|||||||
return 'function ' + alias_name + ' {\n' \
|
return 'function ' + alias_name + ' {\n' \
|
||||||
' $history = (Get-History -Count 1).CommandLine;\n' \
|
' $history = (Get-History -Count 1).CommandLine;\n' \
|
||||||
' if (-not [string]::IsNullOrWhiteSpace($history)) {\n' \
|
' if (-not [string]::IsNullOrWhiteSpace($history)) {\n' \
|
||||||
' $fuck = $(thefuck $history);\n' \
|
' $fuck = $(thefuck $args $history);\n' \
|
||||||
' if (-not [string]::IsNullOrWhiteSpace($fuck)) {\n' \
|
' if (-not [string]::IsNullOrWhiteSpace($fuck)) {\n' \
|
||||||
' if ($fuck.StartsWith("echo")) { $fuck = $fuck.Substring(5); }\n' \
|
' if ($fuck.StartsWith("echo")) { $fuck = $fuck.Substring(5); }\n' \
|
||||||
' else { iex "$fuck"; }\n' \
|
' else { iex "$fuck"; }\n' \
|
||||||
|
Loading…
x
Reference in New Issue
Block a user