mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-18 12:06:04 +00:00
Update readme
This commit is contained in:
parent
293f16c3c8
commit
3d56204f92
@ -245,18 +245,18 @@ and optional `enabled_by_default`, `requires_output` and `priority` variables.
|
||||
Simple example of the rule for running script with `sudo`:
|
||||
|
||||
```python
|
||||
def match(command, settings):
|
||||
def match(command):
|
||||
return ('permission denied' in command.stderr.lower()
|
||||
or 'EACCES' in command.stderr)
|
||||
|
||||
|
||||
def get_new_command(command, settings):
|
||||
def get_new_command(command):
|
||||
return 'sudo {}'.format(command.script)
|
||||
|
||||
# Optional:
|
||||
enabled_by_default = True
|
||||
|
||||
def side_effect(command, settings):
|
||||
def side_effect(command, fixed_command):
|
||||
subprocess.call('chmod 777 .', shell=True)
|
||||
|
||||
priority = 1000 # Lower first, default is 1000
|
||||
|
Loading…
x
Reference in New Issue
Block a user