mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-16 07:38:50 +00:00
15 lines
289 B
Python
15 lines
289 B
Python
import os
|
|
from thefuck.utils import for_app
|
|
|
|
|
|
@for_app('cat', at_least=1)
|
|
def match(command):
|
|
return (
|
|
command.output.startswith('cat: ') and
|
|
os.path.isdir(command.script_parts[1])
|
|
)
|
|
|
|
|
|
def get_new_command(command):
|
|
return command.script.replace('cat', 'ls', 1)
|