From e572cab1f3a13b0536e58cc7070a4d8cfbebb2ba Mon Sep 17 00:00:00 2001 From: mcarton Date: Mon, 20 Jul 2015 21:08:46 +0200 Subject: [PATCH] Have the README look better --- README.md | 15 +++++++++------ 1 file changed, 9 insertions(+), 6 deletions(-) diff --git a/README.md b/README.md index 3238f454..f1ba1a1e 100644 --- a/README.md +++ b/README.md @@ -200,16 +200,19 @@ Bundled, but not enabled by default: ## Creating your own rules For adding your own rule you should create `your-rule-name.py` -in `~/.thefuck/rules`. Rule should contain two functions: -`match(command: Command, settings: Settings) -> bool` -and `get_new_command(command: Command, settings: Settings) -> str`. -Also the rule can contain optional function -`side_effect(command: Command, settings: Settings) -> None` and +in `~/.thefuck/rules`. The rule should contain two functions: +```python +match(command: Command, settings: Settings) -> bool +get_new_command(command: Command, settings: Settings) -> str +``` + +Also the rule can contain an optional function +`side_effect(command: Command, settings: Settings) -> None` and an optional boolean `enabled_by_default`. `Command` has three attributes: `script`, `stdout` and `stderr`. -`Settings` is a special object filled with `~/.thefuck/settings.py` and values from env, [more](#settings). +`Settings` is a special object filled with `~/.thefuck/settings.py` and values from env ([see more below](#settings)). Simple example of the rule for running script with `sudo`: