mirror of
https://github.com/nvbn/thefuck.git
synced 2025-01-31 02:01:13 +00:00
add comments to the code
This commit is contained in:
parent
d898a4df69
commit
cbfa1ae196
@ -1,6 +1,10 @@
|
|||||||
from thefuck.utils import get_all_executables, which
|
from thefuck.utils import get_all_executables, which
|
||||||
|
|
||||||
|
# this rule is activated when the typed command is
|
||||||
|
# in uppercase letters and if the command is not
|
||||||
|
# executed. However in order to activate this rule
|
||||||
|
# it is necessary the first word of the whole command
|
||||||
|
# to be valid.
|
||||||
def match(command):
|
def match(command):
|
||||||
return (command.script.isupper()
|
return (command.script.isupper()
|
||||||
and not which(command.script_parts[0])
|
and not which(command.script_parts[0])
|
||||||
@ -8,7 +12,7 @@ def match(command):
|
|||||||
or 'is not recognized as' in command.output)
|
or 'is not recognized as' in command.output)
|
||||||
and (command.script_parts[0].lower() in get_all_executables()))
|
and (command.script_parts[0].lower() in get_all_executables()))
|
||||||
|
|
||||||
|
# returns the same command in lowercase letters
|
||||||
def get_new_command(cmd):
|
def get_new_command(cmd):
|
||||||
return cmd.script.lower()
|
return cmd.script.lower()
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user