1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-02-20 20:09:07 +00:00

Add ... --help to man suggestions

This is along the lines of what @waldyrious suggested in
https://github.com/nvbn/thefuck/issues/546, but it just adds a new
suggestion rather than replacing the other ones.
This commit is contained in:
Joseph Frazier 2016-10-03 03:54:13 -04:00
parent db7dffdb44
commit 5dbbb3b1ed
2 changed files with 8 additions and 2 deletions

View File

@ -23,7 +23,7 @@ def test_not_match(command):
@pytest.mark.parametrize('command, new_command', [
(Command('man read'), ['man 3 read', 'man 2 read']),
(Command('man read'), ['man 3 read', 'man 2 read', 'read --help']),
(Command('man 2 read'), 'man 3 read'),
(Command('man 3 read'), 'man 2 read'),
(Command('man -s2 read'), 'man -s3 read'),

View File

@ -18,4 +18,10 @@ def get_new_command(command):
split_cmd2.insert(1, ' 2 ')
split_cmd3.insert(1, ' 3 ')
return ["".join(split_cmd3), "".join(split_cmd2)]
last_arg = command.script_parts[-1]
return [
"".join(split_cmd3),
"".join(split_cmd2),
last_arg + ' --help',
]