diff options
author | Danny Nemer <hi@DannyNemer.com> | 2015-09-21 10:08:36 -0400 |
---|---|---|
committer | Jeremiah Senkpiel <fishrock123@rocketmail.com> | 2017-03-17 17:01:32 -0400 |
commit | 5bda5faffdeefa448965159e524eacdd14490436 (patch) | |
tree | 9c6402385483d477c06e83e5fc84255f2f5e9d07 /doc | |
parent | df69d95b764c06a8ed140357b9a4078ef7322d9c (diff) | |
download | android-node-v8-5bda5faffdeefa448965159e524eacdd14490436.tar.gz android-node-v8-5bda5faffdeefa448965159e524eacdd14490436.tar.bz2 android-node-v8-5bda5faffdeefa448965159e524eacdd14490436.zip |
readline: add option to stop duplicates in history
Adds `options.deDupeHistory` for `readline.createInterface(options)`. If
`options.deDupeHistory` is `true`, when a new input line being added to
the history list duplicates an older one, removes the older line from
the list. Defaults to `false`.
Many users would appreciate this option, as it is a common setting in
shells. This option certainly should not be default behavior, as it
would be problematic in applications such as the `repl`, which inherits
from the readline `Interface`.
Extends documentation to reflect this API addition.
Adds tests for when `options.deDupeHistory` is truthy, and when
`options.deDupeHistory` is falsey.
PR-URL: https://github.com/nodejs/node/pull/2982
Reviewed-By: Jeremiah Senkpiel <fishrock123@rocketmail.com>
Diffstat (limited to 'doc')
-rw-r--r-- | doc/api/readline.md | 3 |
1 files changed, 3 insertions, 0 deletions
diff --git a/doc/api/readline.md b/doc/api/readline.md index 878721bb4d..e471daecae 100644 --- a/doc/api/readline.md +++ b/doc/api/readline.md @@ -370,6 +370,9 @@ changes: `crlfDelay` milliseconds, both `\r` and `\n` will be treated as separate end-of-line input. Default to `100` milliseconds. `crlfDelay` will be coerced to `[100, 2000]` range. + * `deDupeHistory` {boolean} If `true`, when a new input line added to the + history list duplicates an older one, this removes the older line from the + list. Defaults to `false`. The `readline.createInterface()` method creates a new `readline.Interface` instance. |