diff --git a/README.md b/README.md index 08ba5b73..d85cda0e 100644 --- a/README.md +++ b/README.md @@ -146,6 +146,7 @@ sudo pip install thefuck --upgrade The Fuck tries to match a rule for the previous command, creates a new command using the matched rule and runs it. Rules enabled by default are as follows: +* `cargo` – run `cargo build` instead of `cargo`; * `cd_correction` – spellchecks and correct failed cd commands; * `cd_mkdir` – creates directories before cd'ing into them; * `cd_parent` – changes `cd..` to `cd ..`; diff --git a/thefuck/rules/cargo.py b/thefuck/rules/cargo.py new file mode 100644 index 00000000..e8cee600 --- /dev/null +++ b/thefuck/rules/cargo.py @@ -0,0 +1,6 @@ +def match(command, settings): + return command.script == 'cargo' + + +def get_new_command(command, settings): + return 'cargo build'