Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
@sudo_support
def get_new_command(command):
invalid_operation = command.output.split()[-1]
if invalid_operation == 'uninstall':
return [command.script.replace('uninstall', 'remove')]
else:
operations = _get_operations(command.script_parts[0])
return replace_command(command, invalid_operation, operations)
@sudo_support
def match(command):
return (not which(command.script_parts[0])
and ('not found' in command.output
or 'is not recognized as' in command.output)
and bool(get_close_matches(command.script_parts[0],
get_all_executables())))
@sudo_support
@for_app('hostscli')
def match(command):
errors = [no_command, no_website]
for error in errors:
if error in command.output:
return True
return False
@sudo_support
def get_new_command(command):
return 'python ' + command.script
@sudo_support
@for_app('lein')
def match(command):
return (command.script.startswith('lein')
and "is not a task. See 'lein help'" in command.output
and 'Did you mean this?' in command.output)
@sudo_support
def get_new_command(command):
return re.sub(u' ', ' ', command.script)
@sudo_support
def get_new_command(command):
return u'{} --no-preserve-root'.format(command.script)
@sudo_support
def match(command):
return ('command not found' in command.output.lower()
and u' ' in command.script)
@sudo_support
@for_app('dnf')
def match(command):
return 'no such command' in command.output.lower()
@sudo_support
@for_app('apt', 'apt-get', 'apt-cache')
def match(command):
return 'E: Invalid operation' in command.output