From 01cf199866ad0638772720c58a37e7beca342507 Mon Sep 17 00:00:00 2001 From: mcarton Date: Sat, 6 Jun 2015 16:56:28 +0200 Subject: [PATCH] Add a `cargo` rule --- README.md | 1 + thefuck/rules/cargo.py | 6 ++++++ 2 files changed, 7 insertions(+) create mode 100644 thefuck/rules/cargo.py 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'