1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-01-18 12:06:04 +00:00

#74 Don't fail when runned without args

This commit is contained in:
nvbn 2015-04-21 14:26:45 +02:00
parent d09238a6e8
commit d5b4bddc4c
2 changed files with 5 additions and 0 deletions

View File

@ -61,6 +61,7 @@ def test_get_command():
stdout=PIPE,
stderr=PIPE,
env={'LANG': 'C'})
assert main.get_command(Mock(), ['']) is None
def test_get_matched_rule():

View File

@ -80,6 +80,10 @@ def get_command(settings, args):
script = ' '.join(arg.decode('utf-8') for arg in args[1:])
else:
script = ' '.join(args[1:])
if not script:
return
result = Popen(script, shell=True, stdout=PIPE, stderr=PIPE,
env=dict(os.environ, LANG='C'))
if wait_output(settings, result):