mirror of
https://github.com/KevinMidboe/motdGO.git
synced 2025-10-28 17:20:24 +00:00
Added motd parser
This commit is contained in:
@@ -14,7 +14,7 @@ var (
|
||||
font *string = flag.String("font", "", "Font name to use")
|
||||
fontpath *string = flag.String("fontpath", "", "Font path to load fonts from")
|
||||
colors *string = flag.String("colors", "", "Character colors separated by ';'\n\tPossible colors: black, red, green, yellow, blue, magenta, cyan, white, or any hexcode (f.e. '885DBA')")
|
||||
parser *string = flag.String("parser", "terminal", "Parser to use\tPossible parsers: terminal, html")
|
||||
parser *string = flag.String("parser", "terminal", "Parser to use\tPossible parsers: terminal, html, motd")
|
||||
file *string = flag.String("file", "", "File to write to")
|
||||
)
|
||||
|
||||
|
||||
@@ -22,6 +22,8 @@ var parsers map[string]Parser = map[string]Parser{
|
||||
"terminal": {"terminal", "", "", "\n", nil},
|
||||
// Parser for HTML code
|
||||
"html": {"html", "<code>", "</code>", "<br>", map[string]string{" ": " "}},
|
||||
// Parser for motd file
|
||||
"motd": {"motd", "#!/bin/sh\ncat << 'EOF'\n", "EOF", "\n", nil},
|
||||
}
|
||||
|
||||
// GetParser returns a parser by its key
|
||||
|
||||
Reference in New Issue
Block a user