1
0
scáthán de https://github.com/quitesimpleorg/hs9001.git sioncronaithe 2025-01-31 13:55:33 +01:00
Albert S c67d38482d add: Fix panic when history command returns nothing
If you disable bash history files alltogether, "history 1" will not contain
anything on first launch of a terminal and therefore the regex
has nothing to parse, so we get an out of bounds array access.
So fix this.

Though it's a dirty silent fail now, I don't want error messages/warnings
everytime I open a shell.
2021-03-21 10:43:06 +01:00
2021-03-20 20:18:27 +01:00
2021-03-20 20:18:27 +01:00
2021-03-20 20:18:27 +01:00
2021-03-20 20:42:35 +01:00

hs9001

Setup

go build
#move hs9001 to a PATH location
# Initialize database
hs9001 init

Add this to .bashrc

if [ -n "$PS1" ] ; then
    PROMPT_COMMAND='hs9001 add "$(history 1)"'
fi

Usage

hs9001 search "term"

Is is recommended to create an aias for search to make life easier.

Cur síos
Bash history put into sqlite so it can be searched
Readme ISC 91 KiB
Teangacha
Go 99.7%
Makefile 0.3%