func execAsync(command string, args ...string) error { e := exec.Command(command, args...).Start() if e != nil { log.Println(term.Red("Launch failed error"), e, args) } return e }
func logE(action string, e error) (wasErr bool) { if e != nil { wasErr = true log.Println(term.Red("Error"), e) } return wasErr }
func printSubByRef(title string, byref subByRef) { if len(byref) == 0 { return } fmt.Println(term.Underscore + title + term.Reset) for imdb, bylang := range byref { fmt.Println(term.Red("Movie ref :"), imdb) for lang, list := range bylang { fmt.Println(" ", term.Yellow(lang)) for index, sub := range list { fmt.Println(" ", term.FgGreen, index, term.Reset, sub.SubAddDate[:10], term.Yellow(sub.SubDownloadsCnt), sub.UserNickName, term.Bracket(sub.UserRank)) //~ fmt.Printf(" ", " ", "#%d : %# v\n", index,sub) } } } fmt.Println() }
func testFatal(e error) { if e != nil { log.Println(term.Red("Applet load error"), e) os.Exit(2) } }