diff options
Diffstat (limited to 'main.go')
| -rw-r--r-- | main.go | 39 |
1 files changed, 4 insertions, 35 deletions
@@ -4,15 +4,11 @@ package main import ( - "debug/buildinfo" "embed" - "fmt" "os" - "path/filepath" "unicode" - "go.wit.com/dev/davecgh/spew" - "go.wit.com/log" + "go.wit.com/lib/gui/prep" ) // sent via -ldflags @@ -27,7 +23,9 @@ var resources embed.FS func main() { me = new(mainType) - me.once.Do(initMain) + // autocomplete must be processed before there is anything sent to STDOUT or STDERR + me.sh = prep.Bash3(&argv) // add support for bash autocomplete with go-arg + me.homedir, _ = os.UserHomeDir() // store shortcut here todo: add better logic if argv.Upgrade != nil { doUpgrade() @@ -89,32 +87,3 @@ func trimNonNumericFromStart(s string) string { } return "" } - -func dumpDebug() { - // Get absolute path of the currently running binary - exePath, err := os.Executable() - if err != nil { - fmt.Println("Error getting executable path:", err) - return - } - - // Resolve symlinks if necessary - exePath, err = filepath.EvalSymlinks(exePath) - if err != nil { - fmt.Println("Error resolving symlink:", err) - return - } - - // Read build info - bi, err := buildinfo.ReadFile(exePath) - if err != nil { - fmt.Println("Error reading build info:", err) - return - } - - log.Infof("%s built with Go version: %s\n", exePath, bi.GoVersion) - spew.Dump(bi) - for _, dep := range bi.Deps { - fmt.Printf("Dependency: %s %s\n", dep.Path, dep.Version) - } -} |
