Re: [go-nuts] Re: need a package to read/write shell history flat file database
This package (FZF) is also using the history file, perhaps there's something usable inside. https://github.com/junegunn/fzf Op zondag 11 februari 2024 om 06:41:11 UTC+1 schreef Kurtis Rader: > Thanks, but that requires me to implement the code I would rather not have > to reinvent given that shells like Bash, Ksh, and Fish already have code to > do what I need. The problem is that those solutions are written in C and > C++ respectively rather than Go. While I consider myself an expert in C > (having started programming with it around 1985) I am only minimally > competent in C++. I'll translate the Fish C++ code into Go if I have to but > am hoping there is a published Go equivalent to save me that effort. > > P.S., This is to remove the dependency on a daemon process to update a > BoltDB database by the Fish shell. The BoltDB dependency (go.etcd.io/bbolt) > greatly increases the size and complexity of the Fish shell. The opaque > binary database managed by BoltDB is also annoying. It would be preferable > to use a flat file database using JSON or text protobufs for storing > command history. > > On Sat, Feb 10, 2024 at 9:15 PM 'Dan Kortschak' via golang-nuts < > golan...@googlegroups.com> wrote: > >> On Sat, 2024-02-10 at 21:01 -0800, Kurtis Rader wrote: >> > The only solution I can find that gets close to my requirements is >> > https://github.com/ergochat/readline, but AFAICT it does not handle >> > updates to the on-disk history file by concurrently executing >> > processes. >> >> There is also https://pkg.go.dev/github.com/peterh/liner, which also >> does not handle history persistence, but which makes it relatively easy >> to add. >> >> -- >> You received this message because you are subscribed to the Google Groups >> "golang-nuts" group. >> To unsubscribe from this group and stop receiving emails from it, send an >> email to golang-nuts...@googlegroups.com. >> To view this discussion on the web visit >> https://groups.google.com/d/msgid/golang-nuts/e37a98a811c8e1cccfef8feffafef5260e7e5e56.camel%40kortschak.io >> . >> > > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/ef46ee58-f20d-47c1-baef-fdf63681c2e9n%40googlegroups.com.
Re: [go-nuts] Re: need a package to read/write shell history flat file database
Thanks, but that requires me to implement the code I would rather not have to reinvent given that shells like Bash, Ksh, and Fish already have code to do what I need. The problem is that those solutions are written in C and C++ respectively rather than Go. While I consider myself an expert in C (having started programming with it around 1985) I am only minimally competent in C++. I'll translate the Fish C++ code into Go if I have to but am hoping there is a published Go equivalent to save me that effort. P.S., This is to remove the dependency on a daemon process to update a BoltDB database by the Fish shell. The BoltDB dependency (go.etcd.io/bbolt) greatly increases the size and complexity of the Fish shell. The opaque binary database managed by BoltDB is also annoying. It would be preferable to use a flat file database using JSON or text protobufs for storing command history. On Sat, Feb 10, 2024 at 9:15 PM 'Dan Kortschak' via golang-nuts < golang-nuts@googlegroups.com> wrote: > On Sat, 2024-02-10 at 21:01 -0800, Kurtis Rader wrote: > > The only solution I can find that gets close to my requirements is > > https://github.com/ergochat/readline, but AFAICT it does not handle > > updates to the on-disk history file by concurrently executing > > processes. > > There is also https://pkg.go.dev/github.com/peterh/liner, which also > does not handle history persistence, but which makes it relatively easy > to add. > > -- > You received this message because you are subscribed to the Google Groups > "golang-nuts" group. > To unsubscribe from this group and stop receiving emails from it, send an > email to golang-nuts+unsubscr...@googlegroups.com. > To view this discussion on the web visit > https://groups.google.com/d/msgid/golang-nuts/e37a98a811c8e1cccfef8feffafef5260e7e5e56.camel%40kortschak.io > . > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD-WSa7Xc%2BuOSU_e-ZU9HeREi48gpJfGWZMaO%3DOUpeB3Jg%40mail.gmail.com.
Re: [go-nuts] Re: need a package to read/write shell history flat file database
On Sat, 2024-02-10 at 21:01 -0800, Kurtis Rader wrote: > The only solution I can find that gets close to my requirements is > https://github.com/ergochat/readline, but AFAICT it does not handle > updates to the on-disk history file by concurrently executing > processes. There is also https://pkg.go.dev/github.com/peterh/liner, which also does not handle history persistence, but which makes it relatively easy to add. -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/e37a98a811c8e1cccfef8feffafef5260e7e5e56.camel%40kortschak.io.
[go-nuts] Re: need a package to read/write shell history flat file database
The only solution I can find that gets close to my requirements is https://github.com/ergochat/readline, but AFAICT it does not handle updates to the on-disk history file by concurrently executing processes. On Sat, Feb 10, 2024 at 6:55 PM Kurtis Rader wrote: > I'm looking for a package that will read/write a flat file database of > shell commands from multiple processes. I could take an existing > implementation in a different language, such as the one used by Bash or > Fish, and rewrite it in Go but was hoping someone has already done this. > The specific structure (e.g., YAML, JSON, something else) isn't important. > I'm just looking for an implementation that is known to correctly handle > appending new entries from concurrently running processes and rewriting the > file when entries are deleted. > > -- > Kurtis Rader > Caretaker of the exceptional canines Junior and Hank > -- Kurtis Rader Caretaker of the exceptional canines Junior and Hank -- You received this message because you are subscribed to the Google Groups "golang-nuts" group. To unsubscribe from this group and stop receiving emails from it, send an email to golang-nuts+unsubscr...@googlegroups.com. To view this discussion on the web visit https://groups.google.com/d/msgid/golang-nuts/CABx2%3DD-qpaHvR-6RrKrf_VzdMGVpYediekNNZ7Ewo6Odg0XW6w%40mail.gmail.com.