mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-20 09:39:01 +00:00
Added pacman invalid option rule
This commit is contained in:
parent
3bbd0e9463
commit
7fd4f3ef74
@ -321,6 +321,7 @@ The following rules are enabled by default on specific platforms only:
|
|||||||
* `dnf_no_such_command` – fixes mistyped DNF commands;
|
* `dnf_no_such_command` – fixes mistyped DNF commands;
|
||||||
* `nixos_cmd_not_found` – installs apps on NixOS;
|
* `nixos_cmd_not_found` – installs apps on NixOS;
|
||||||
* `pacman` – installs app with `pacman` if it is not installed (uses `yay` or `yaourt` if available);
|
* `pacman` – installs app with `pacman` if it is not installed (uses `yay` or `yaourt` if available);
|
||||||
|
* `pacman_invalid_option` – replaces lowercase pacman options with uppercase.
|
||||||
* `pacman_not_found` – fixes package name with `pacman`, `yay` or `yaourt`.
|
* `pacman_not_found` – fixes package name with `pacman`, `yay` or `yaourt`.
|
||||||
|
|
||||||
The following commands are bundled with *The Fuck*, but are not enabled by
|
The following commands are bundled with *The Fuck*, but are not enabled by
|
||||||
|
14
thefuck/rules/pacman_invalid_option.py
Normal file
14
thefuck/rules/pacman_invalid_option.py
Normal file
@ -0,0 +1,14 @@
|
|||||||
|
from thefuck.specific.archlinux import archlinux_env
|
||||||
|
import re
|
||||||
|
|
||||||
|
|
||||||
|
def match(command):
|
||||||
|
return "error: invalid option" in command.output
|
||||||
|
|
||||||
|
|
||||||
|
def get_new_command(command):
|
||||||
|
opt = re.findall(r" -[dqrstuf]", command.script)[0]
|
||||||
|
return re.sub(opt, opt.upper(), command.script)
|
||||||
|
|
||||||
|
|
||||||
|
enabled_by_default=true, pacman = archlinux_env()
|
Loading…
x
Reference in New Issue
Block a user