Compare commits
3 Commits
5ad2c37ba2
...
8854b17ebc
| Author | SHA1 | Date | |
|---|---|---|---|
|
|
8854b17ebc | ||
|
|
6fa46f4b75 | ||
|
|
a89393186f |
15
README.md
15
README.md
@@ -2311,15 +2311,18 @@ neoirc/
|
||||
├── cmd/
|
||||
│ ├── neoircd/ # Server binary entry point
|
||||
│ │ └── main.go
|
||||
│ └── neoirc-cli/ # TUI client
|
||||
│ ├── main.go # Command handling, poll loop
|
||||
│ ├── ui.go # tview-based terminal UI
|
||||
│ └── api/
|
||||
│ ├── client.go # HTTP API client library
|
||||
│ └── types.go # Request/response types
|
||||
│ └── neoirc-cli/ # TUI client entry point
|
||||
│ └── main.go # Minimal bootstrapping (calls internal/cli)
|
||||
├── internal/
|
||||
│ ├── broker/ # In-memory pub/sub for long-poll notifications
|
||||
│ │ └── broker.go
|
||||
│ ├── cli/ # TUI client implementation
|
||||
│ │ ├── app.go # App struct, command handling, poll loop
|
||||
│ │ ├── ui.go # tview-based terminal UI
|
||||
│ │ └── api/
|
||||
│ │ ├── client.go # HTTP API client library
|
||||
│ │ ├── types.go # Request/response types
|
||||
│ │ └── hashcash.go # Hashcash proof-of-work minting
|
||||
│ ├── config/ # Viper-based configuration
|
||||
│ │ └── config.go
|
||||
│ ├── db/ # Database access and migrations
|
||||
|
||||
@@ -1,17 +1,8 @@
|
||||
// Package main is the entry point for the neoirc-cli client.
|
||||
package main
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
"git.eeqj.de/sneak/neoirc/internal/cli"
|
||||
)
|
||||
import "git.eeqj.de/sneak/neoirc/internal/cli"
|
||||
|
||||
func main() {
|
||||
err := cli.Run()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
cli.Run()
|
||||
}
|
||||
|
||||
@@ -1,8 +1,9 @@
|
||||
// Package cli implements the neoirc-cli client logic.
|
||||
// Package cli implements the neoirc-cli terminal client.
|
||||
package cli
|
||||
|
||||
import (
|
||||
"fmt"
|
||||
"os"
|
||||
"strings"
|
||||
"sync"
|
||||
"time"
|
||||
@@ -31,8 +32,8 @@ type App struct {
|
||||
stopPoll chan struct{}
|
||||
}
|
||||
|
||||
// Run starts the neoirc-cli application.
|
||||
func Run() error {
|
||||
// Run creates and runs the CLI application.
|
||||
func Run() {
|
||||
app := &App{ //nolint:exhaustruct
|
||||
ui: NewUI(),
|
||||
nick: "guest",
|
||||
@@ -50,7 +51,11 @@ func Run() error {
|
||||
"or [yellow]/help[white] for commands",
|
||||
)
|
||||
|
||||
return app.ui.Run()
|
||||
err := app.ui.Run()
|
||||
if err != nil {
|
||||
fmt.Fprintf(os.Stderr, "Error: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
|
||||
func (a *App) handleInput(text string) {
|
||||
|
||||
Reference in New Issue
Block a user