2021-10-10 21:36:04 +03:00
|
|
|
// gorc project
|
2022-01-24 04:24:58 +02:00
|
|
|
// Copyright (C) 2022 IllusionMan1212
|
2021-10-10 21:36:04 +03:00
|
|
|
//
|
|
|
|
|
// This program is free software; you can redistribute it and/or modify
|
|
|
|
|
// it under the terms of the GNU General Public License as published by
|
|
|
|
|
// the Free Software Foundation; either version 3 of the License, or
|
|
|
|
|
// (at your option) any later version.
|
|
|
|
|
//
|
|
|
|
|
// This program is distributed in the hope that it will be useful,
|
|
|
|
|
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
|
|
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
|
|
// GNU General Public License for more details.
|
|
|
|
|
//
|
|
|
|
|
// You should have received a copy of the GNU General Public License along
|
|
|
|
|
// with this program; if not, see https://www.gnu.org/licenses.
|
|
|
|
|
|
|
|
|
|
package main
|
|
|
|
|
|
|
|
|
|
import (
|
|
|
|
|
"log"
|
2021-10-21 01:12:45 +03:00
|
|
|
|
|
|
|
|
tea "github.com/charmbracelet/bubbletea"
|
2021-11-13 06:38:12 +02:00
|
|
|
"github.com/illusionman1212/gorc/ui/app"
|
2021-10-10 21:36:04 +03:00
|
|
|
)
|
|
|
|
|
|
|
|
|
|
func main() {
|
2022-01-24 01:25:01 +02:00
|
|
|
gorc := app.InitialState()
|
2022-01-15 21:56:06 +02:00
|
|
|
|
|
|
|
|
p := tea.NewProgram(
|
2022-01-24 01:25:01 +02:00
|
|
|
gorc,
|
2021-12-13 09:38:07 +02:00
|
|
|
tea.WithAltScreen(),
|
|
|
|
|
tea.WithMouseCellMotion(),
|
2022-01-15 21:56:06 +02:00
|
|
|
)
|
|
|
|
|
|
2022-01-24 01:25:01 +02:00
|
|
|
gorc.Client.Tea = p
|
2022-01-15 21:56:06 +02:00
|
|
|
|
|
|
|
|
f, err := tea.LogToFile("gorc.log", "gorc")
|
|
|
|
|
defer f.Close()
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
2021-10-21 01:12:45 +03:00
|
|
|
log.Fatal(err)
|
|
|
|
|
}
|
2022-01-15 21:56:06 +02:00
|
|
|
|
|
|
|
|
err = p.Start()
|
|
|
|
|
|
|
|
|
|
if err != nil {
|
|
|
|
|
log.Println(err)
|
|
|
|
|
}
|
2021-10-10 21:36:04 +03:00
|
|
|
}
|