mirror of
https://github.com/go-shiori/shiori.git
synced 2024-11-16 22:25:13 +08:00
29 lines
603 B
Go
29 lines
603 B
Go
package cmd
|
|
|
|
import (
|
|
"github.com/fatih/color"
|
|
"golang.org/x/crypto/ssh/terminal"
|
|
"os"
|
|
)
|
|
|
|
var (
|
|
cIndex = color.New(color.FgHiCyan)
|
|
cSymbol = color.New(color.FgHiMagenta)
|
|
cTitle = color.New(color.FgHiGreen).Add(color.Bold)
|
|
cReadTime = color.New(color.FgHiMagenta)
|
|
cURL = color.New(color.FgHiYellow)
|
|
cError = color.New(color.FgHiRed)
|
|
cExcerpt = color.New(color.FgHiWhite)
|
|
cTag = color.New(color.FgHiBlue)
|
|
)
|
|
|
|
func getTerminalWidth() int {
|
|
width, _, _ := terminal.GetSize(int(os.Stdin.Fd()))
|
|
return width
|
|
}
|
|
|
|
func checkError(err error) {
|
|
if err != nil {
|
|
panic(err)
|
|
}
|
|
}
|