mirror of
https://github.com/issadarkthing/gomu.git
synced 2025-04-26 13:49:21 +08:00
add print version
This commit is contained in:
parent
911cd17321
commit
377ee6ac48
15
start.go
15
start.go
@ -4,6 +4,7 @@ package main
|
||||
|
||||
import (
|
||||
"flag"
|
||||
"fmt"
|
||||
"log"
|
||||
"os"
|
||||
"strings"
|
||||
@ -14,6 +15,10 @@ import (
|
||||
"github.com/ztrue/tracerr"
|
||||
)
|
||||
|
||||
const VERSION = "v1.3.1"
|
||||
|
||||
var gomu *Gomu
|
||||
|
||||
// created so we can keep track of childrens in slices
|
||||
type Panel interface {
|
||||
HasFocus() bool
|
||||
@ -122,11 +127,13 @@ func (g *Gomu) SetUnfocusPanel(panel Panel) {
|
||||
g.PrevPanel.SetTitleColor((g.TextColor))
|
||||
}
|
||||
|
||||
// one single instance of global variable
|
||||
var gomu *Gomu
|
||||
|
||||
func start(application *tview.Application, args Args) {
|
||||
|
||||
if *args.version {
|
||||
fmt.Printf("Gomu %s\n", VERSION)
|
||||
return
|
||||
}
|
||||
|
||||
// override default border
|
||||
// change double line border to one line border when focused
|
||||
tview.Borders.HorizontalFocus = tview.Borders.Horizontal
|
||||
@ -301,6 +308,7 @@ type Args struct {
|
||||
config *string
|
||||
load *bool
|
||||
music *string
|
||||
version *bool
|
||||
}
|
||||
|
||||
func getArgs() Args {
|
||||
@ -309,6 +317,7 @@ func getArgs() Args {
|
||||
config: flag.String("config", "~/.config/gomu/config", "specify config file"),
|
||||
load: flag.Bool("load", true, "load previous queue"),
|
||||
music: flag.String("music", "~/music", "specify music directory"),
|
||||
version: flag.Bool("version", false, "print gomu version"),
|
||||
}
|
||||
|
||||
flag.Parse()
|
||||
|
Loading…
x
Reference in New Issue
Block a user