mirror of
https://github.com/nvbn/thefuck.git
synced 2025-03-16 07:38:50 +00:00
Fix the tests for inside virtualenvs and add warning if localization appears impossible. Remove the language warnings for en_US locales and make sure they appear for others.
15 lines
370 B
Python
15 lines
370 B
Python
import gettext
|
|
|
|
|
|
def match(command):
|
|
eisdir = gettext.translation('libc', fallback=True).gettext('Is a directory')
|
|
return (
|
|
command.script.startswith('cat') and
|
|
command.output.startswith('cat: ') and
|
|
command.output.rstrip().endswith(': %s' % eisdir)
|
|
)
|
|
|
|
|
|
def get_new_command(command):
|
|
return command.script.replace('cat', 'ls', 1)
|