wocao
This commit is contained in:
@@ -0,0 +1,32 @@
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
|
||||
package gitctl
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"os"
|
||||
|
||||
tea "github.com/charmbracelet/bubbletea"
|
||||
)
|
||||
|
||||
func Run(args []string) {
|
||||
fs := flag.NewFlagSet("ctl", flag.ExitOnError)
|
||||
manage := fs.String("manage", "http://127.0.1.1:8094", "ManageService base URL (a simplegit -gitrpc listen address; simplegit no longer has a separate -manage port, ManageService is served on -gitrpc)")
|
||||
fs.Parse(args)
|
||||
|
||||
client := newManageClient(*manage)
|
||||
p := tea.NewProgram(newModel(client, *manage), tea.WithAltScreen())
|
||||
if _, err := p.Run(); err != nil {
|
||||
fmt.Fprintf(os.Stderr, "gitctl: %v\n", err)
|
||||
os.Exit(1)
|
||||
}
|
||||
}
|
||||
Reference in New Issue
Block a user