1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-31 02:01:13 +00:00

Update readme

This commit is contained in:
nvbn 2015-09-07 19:13:17 +03:00
parent 293f16c3c8
commit 3d56204f92

View File

@ -245,18 +245,18 @@ and optional `enabled_by_default`, `requires_output` and `priority` variables.
Simple example of the rule for running script with `sudo`: Simple example of the rule for running script with `sudo`:
```python ```python
def match(command, settings): def match(command):
return ('permission denied' in command.stderr.lower() return ('permission denied' in command.stderr.lower()
or 'EACCES' in command.stderr) or 'EACCES' in command.stderr)
def get_new_command(command, settings): def get_new_command(command):
return 'sudo {}'.format(command.script) return 'sudo {}'.format(command.script)
# Optional: # Optional:
enabled_by_default = True enabled_by_default = True
def side_effect(command, settings): def side_effect(command, fixed_command):
subprocess.call('chmod 777 .', shell=True) subprocess.call('chmod 777 .', shell=True)
priority = 1000 # Lower first, default is 1000 priority = 1000 # Lower first, default is 1000