Secure your code as it's written. Use Snyk Code to scan source code in minutes - no build needed - and fix issues immediately.
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)
def get_new_command(command):
interface = command.output.split(' ')[0][:-1]
possible_interfaces = _get_possible_interfaces()
return replace_command(command, interface, possible_interfaces)
def get_new_command(command):
if 'Usage:' in command.output and len(command.script_parts) > 1:
management_subcommands = _parse_commands(command.output.split('\n'), 'Commands:')
return replace_command(command, command.script_parts[2], management_subcommands)
wrong_command = re.findall(
r"docker: '(\w+)' is not a docker command.", command.output)[0]
return replace_command(command, wrong_command, get_docker_commands())
def get_new_command(command):
misspelled_task = regex.findall(command.stderr)[0]
if misspelled_task in npm_commands:
yarn_command = npm_commands[misspelled_task]
return replace_argument(command.script, misspelled_task, yarn_command)
else:
tasks = _get_all_tasks()
return replace_command(command, misspelled_task, tasks)
def get_new_command(command):
wrong_task = regex.findall(command.output)[0][0]
all_tasks = _get_all_tasks(command.script_parts[0])
return replace_command(command, wrong_task, all_tasks)
def get_new_command(command):
broken_cmd = re.findall(r'Error: Unknown command: ([a-z]+)',
command.output)[0]
return replace_command(command, broken_cmd, _brew_commands())
def get_new_command(command):
misspelled_script = re.findall(
r'.*missing script: (.*)\n', command.output)[0]
return replace_command(command, misspelled_script, get_scripts())
def get_new_command(command):
if no_website in command.output:
return ['hostscli websites']
misspelled_command = re.findall(
r'Error: No such command ".*"', command.output)[0]
commands = ['block', 'unblock', 'websites', 'block_all', 'unblock_all']
return replace_command(command, misspelled_command, commands)
def get_new_command(command):
broken_cmd = re.findall(r"([^:]*): Unknown command.*", command.output)[0]
matched = re.findall(r"Did you mean ([^?]*)?", command.output)
return replace_command(command, broken_cmd, matched)
def get_new_command(command):
misspelled_command = regex.findall(command.output)[0]
return replace_command(command, misspelled_command, _get_operations())