rlwrap
1.1、rlwrap简介
short for:readline wrapper
是什么 ?:a small utility that uses the GNU readline to allow the editing of keyboard input for any command.
开发语言:C
源码仓库:https://github.com/hanslub42/rlwrap
1.2、通过包管理器安装rlwrap
操作系统包管理器安装命令
macOSHomeBrewbrew install rlwrap
GNU/LinuxLinuxBrewbrew install rlwrap
aptsudo apt-get install -y rlwrap
CentOSyumsudo yum install -y rlwrap
dnfsudo dnf install -y rlwrap
openSUSEzyppersudo zypper install -y rlwrap
Alpine Linuxapksudo apk add rlwrap

Arch Linux

ArcoLinux

Manjaro Linux

pacmansudo pacman -Syyu --noconfirm
sudo pacman -S    --noconfirm rlwrap
Gentoo LinuxPortagesudo emerge rlwrap
1.3、通过编译源码安装rlwrap
1.4、rlwrap命令

rlwrap命令的使用格式如下:

rlwrap [option]... <COMMAND> [ARGUMENT]...

示例:

rlwrap -a -- -c -i -f ~/.rlwrap/sqlite3_completions sqlite3

-f FILE指定自动补全的关键字文件。这里是自动补全sqlite3 shell中的命令和SQL语句。

mkdir ~/.rlwrap
echo '.help' | sqlite3 | grep -o '^\.[a-z]* ' >> ~/.rlwrap/sqlite3_completions
echo 'ABORT ACTION ADD AFTER ALL ALTER ANALYZE AND AS ASC ATTACH AUTOINCREMENT BEFORE BEGIN BETWEEN BY CASCADE CASE CAST CHECK COLLATE COLUMN COMMIT CONFLICT CONSTRAINT CREATE CROSS CURRENT_DATE CURRENT_TIME CURRENT_TIMESTAMP DATABASE DEFAULT DEFERRABLE DEFERRED DELETE DESC DETACH DISTINCT DROP EACH ELSE END ESCAPE EXCEPT EXCLUSIVE EXISTS EXPLAIN FAIL FOR FOREIGN FROM FULL GLOB GROUP HAVING IF IGNORE IMMEDIATE IN INDEX INDEXED INITIALLY INNER INSERT INSTEAD INTERSECT INTO IS ISNULL JOIN KEY LEFT LIKE LIMIT MATCH NATURAL NO NOT NOTNULL NULL OF OFFSET ON OR ORDER OUTER PLAN PRAGMA PRIMARY QUERY RAISE RECURSIVE REFERENCES REGEXP REINDEX RELEASE RENAME REPLACE RESTRICT RIGHT ROLLBACK ROW SAVEPOINT SELECT SET TABLE TEMP TEMPORARY THEN TO TRANSACTION TRIGGER UNION UNIQUE UPDATE USING VACUUM VALUES VIEW VIRTUAL WHEN WHERE WITH WITHOUT' >> ~/.rlwrap/sqlite3_completions