correct handling of history args

This fixes several problems with how the builtin `history` command handles
arguments. It now complains and refuses to do anything if the user specifies
incompatible actions (e.g., `--search` and `--clear`). It also fixes a
regression introduced by previous changes with regard to invocations that
don't explicitly specify `--search` or a search term.

Enhances the history man page to clarify the behavior of various options.

This change is already far larger than I like so unit tests will be added
in a separate commit.

Fixes #3224.

Note: This fixes only a couple problems with the interactive `history
--delete` command in the `history` function. The main problem will be
dealt with via issue #31.
This commit is contained in:
Kurtis Rader
2016-07-13 22:33:50 -07:00
parent 4fbc476b19
commit b53f42970c
10 changed files with 398 additions and 246 deletions

6
tests/history.expect.out Normal file
View File

@@ -0,0 +1,6 @@
empty history detected as expected
first history command detected as expected
invalid attempt at multiple history commands detected
history function explicit search succeeded
history function implicit search succeeded
history function implicit search with timestamps succeeded