1
0
mirror of https://github.com/nvbn/thefuck.git synced 2025-09-21 04:32:37 +01:00

Don't suggest man 2/3 foo if no man pages exist

Suggest `foo --help` instead. However, if there are man pages, suggest
`foo --help` after `man 2/3 foo`

This addresses the comment in the previous commit message:

> However, in cases where multiple sections have man pages for `foo`,
> running `man foo` could bring up the "wrong" section of man pages.
> `man read` is an example of this, but that should probably be handled in
> a way that still suggests `foo --help` first when there are *no* man
> pages for `foo` in any section.
This commit is contained in:
Joseph Frazier
2016-10-03 13:13:35 -04:00
parent 8bd6c5da67
commit 0c84eefa55
2 changed files with 11 additions and 4 deletions

View File

@@ -23,7 +23,8 @@ def test_not_match(command):
@pytest.mark.parametrize('command, new_command', [
(Command('man read'), ['read --help', 'man 3 read', 'man 2 read']),
(Command('man read'), ['man 3 read', 'man 2 read', 'read --help']),
(Command('man missing', stderr="No manual entry for missing\n"), ['missing --help']),
(Command('man 2 read'), 'man 3 read'),
(Command('man 3 read'), 'man 2 read'),
(Command('man -s2 read'), 'man -s3 read'),