fix(whois): check if there's at least one argument to whois

This avoids thefuck failing when there's no arguments. It fails with:

```
  ...
  File "thefuck/rules/whois.py", line 26, in get_new_command
    url = command.script.split()[1]
IndexError: list index out of range
```

Signed-off-by: Pablo Santiago Blum de Aguiar <scorphus@gmail.com>
This commit is contained in:
Pablo Santiago Blum de Aguiar
2015-05-20 13:35:31 -03:00
parent 2c3df1ad47
commit 44c06c483e
2 changed files with 5 additions and 1 deletions
+1 -1
View File
@@ -19,7 +19,7 @@ def match(command, settings):
- www.google.fr → subdomain: www, domain: 'google.fr';
- google.co.uk → subdomain: None, domain; 'google.co.uk'.
"""
return 'whois' in command.script
return 'whois' in command.script and len(command.script.split()) > 1
def get_new_command(command, settings):