Compare commits
No commits in common. "master" and "v0.0.20" have entirely different histories.
23
argv.go
23
argv.go
|
@ -4,9 +4,8 @@
|
||||||
package main
|
package main
|
||||||
|
|
||||||
import (
|
import (
|
||||||
|
"fmt"
|
||||||
"os"
|
"os"
|
||||||
|
|
||||||
"go.wit.com/lib/gui/prep"
|
|
||||||
)
|
)
|
||||||
|
|
||||||
/*
|
/*
|
||||||
|
@ -59,15 +58,17 @@ regex -- interact with Googles' Gemini AI
|
||||||
handles shell autocomplete
|
handles shell autocomplete
|
||||||
*/
|
*/
|
||||||
|
|
||||||
func (args) Appname() string {
|
func (a args) DoAutoComplete(argv []string) {
|
||||||
return ARGNAME
|
switch argv[0] {
|
||||||
}
|
case "playback":
|
||||||
|
fmt.Println("long --uuid purge last submit")
|
||||||
func (a args) DoAutoComplete(pb *prep.Auto) {
|
case "clean":
|
||||||
if pb.Cmd == "" {
|
fmt.Println("")
|
||||||
pb.Autocomplete3([]string{"--bash", "interact", "playback", "clean"})
|
default:
|
||||||
} else {
|
if argv[0] == ARGNAME {
|
||||||
pb.SubCommand(pb.Argv...)
|
// list the subcommands here
|
||||||
|
fmt.Println("--json interact playback clean")
|
||||||
|
}
|
||||||
}
|
}
|
||||||
os.Exit(0)
|
os.Exit(0)
|
||||||
}
|
}
|
||||||
|
|
4
build
4
build
|
@ -1,4 +0,0 @@
|
||||||
#!/bin/bash -x
|
|
||||||
|
|
||||||
mkdir -p files/usr/share/bash-completion/completions/
|
|
||||||
regex --bash > files/usr/share/bash-completion/completions/regex
|
|
6
main.go
6
main.go
|
@ -9,6 +9,7 @@ import (
|
||||||
"embed"
|
"embed"
|
||||||
|
|
||||||
"github.com/google/uuid"
|
"github.com/google/uuid"
|
||||||
|
"go.wit.com/dev/alexflint/arg"
|
||||||
"go.wit.com/lib/gui/prep"
|
"go.wit.com/lib/gui/prep"
|
||||||
"go.wit.com/lib/protobuf/chatpb"
|
"go.wit.com/lib/protobuf/chatpb"
|
||||||
"go.wit.com/log"
|
"go.wit.com/log"
|
||||||
|
@ -31,8 +32,9 @@ var configSave bool
|
||||||
|
|
||||||
func main() {
|
func main() {
|
||||||
me = new(mainType)
|
me = new(mainType)
|
||||||
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
prep.Bash(ARGNAME, argv.DoAutoComplete) // this line should be: prep.Bash(argv)
|
||||||
me.auto = prep.Bash3(&argv) // add support for bash autocomplete with go-arg
|
me.myGui = prep.Gui() // prepares the GUI package for go-args
|
||||||
|
me.pp = arg.MustParse(&argv)
|
||||||
|
|
||||||
var err error
|
var err error
|
||||||
// load the default chat protobuf
|
// load the default chat protobuf
|
||||||
|
|
|
@ -6,6 +6,7 @@ package main
|
||||||
import (
|
import (
|
||||||
"context"
|
"context"
|
||||||
|
|
||||||
|
"go.wit.com/dev/alexflint/arg"
|
||||||
"go.wit.com/lib/gadgets"
|
"go.wit.com/lib/gadgets"
|
||||||
"go.wit.com/lib/gui/prep"
|
"go.wit.com/lib/gui/prep"
|
||||||
"go.wit.com/lib/protobuf/chatpb"
|
"go.wit.com/lib/protobuf/chatpb"
|
||||||
|
@ -16,7 +17,7 @@ var me *mainType
|
||||||
|
|
||||||
// this app's variables
|
// this app's variables
|
||||||
type mainType struct {
|
type mainType struct {
|
||||||
auto *prep.Auto // more experiments for bash handling
|
pp *arg.Parser // for parsing the command line args. Yay to alexf lint!
|
||||||
chats *chatpb.Chats // all our prior conversations with regex
|
chats *chatpb.Chats // all our prior conversations with regex
|
||||||
client *genai.Client // the Google Gemini AI client variable
|
client *genai.Client // the Google Gemini AI client variable
|
||||||
ctx context.Context // global context. what does this acutally mean?
|
ctx context.Context // global context. what does this acutally mean?
|
||||||
|
|
Loading…
Reference in New Issue