MCPcopy
hub / github.com/ddworken/hishtory / export

Function export

client/cmd/query.go:135–150  ·  view source on GitHub ↗
(ctx context.Context, query string)

Source from the content-addressed store, hash-verified

133}
134
135func export(ctx context.Context, query string) {
136 db := hctx.GetDb(ctx)
137 err := lib.RetrieveAdditionalEntriesFromRemote(ctx, "export")
138 if err != nil {
139 if lib.IsOfflineError(ctx, err) {
140 fmt.Println("Warning: hishtory is offline so this may be missing recent results from your other machines!")
141 } else {
142 lib.CheckFatalError(err)
143 }
144 }
145 data, err := lib.Search(ctx, db, query, 0)
146 lib.CheckFatalError(err)
147 for i := len(data) - 1; i >= 0; i-- {
148 fmt.Println(data[i].Command)
149 }
150}
151
152func query(ctx context.Context, query string) {
153 db := hctx.GetDb(ctx)

Callers 1

query.goFile · 0.85

Calls 5

GetDbFunction · 0.92
IsOfflineErrorFunction · 0.92
CheckFatalErrorFunction · 0.92
SearchFunction · 0.92

Tested by

no test coverage detected