-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.go
46 lines (30 loc) · 877 Bytes
/
main.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
package main
import (
"time"
"github.com/mt1976/crt/terminal"
menu "github.com/mt1976/mockterm/actions/mainmenu"
cfg "github.com/mt1976/mockterm/config"
l "github.com/mt1976/mockterm/language"
startup "github.com/mt1976/mockterm/start"
)
// config is used to store configuration settings for the program, including terminal
// width and height.
//
// Main is the entry point for the program.
func main() {
C := cfg.Configuration
// create a new instance of the ViewPort
t := terminal.NewWithSize(C.TerminalWidth, C.TerminalHeight)
// start a timer
start := time.Now()
// run the startup sequence
t.SetDelayInSec(C.Delay)
startup.Run(&t)
t.ResetDelay()
// run the main menu
menu.Run(&t)
// stop the timer
elapsed := time.Since(start)
// output the elapsed time
t.Shout(t.Formatters.Bold(l.Done.Text()) + l.Space.Text() + elapsed.String())
}