Improve log and flag help message

This commit is contained in:
Matt Baer 2021-01-20 08:42:23 -05:00
parent 45cda28e42
commit 9244e91e1b

View File

@ -25,7 +25,7 @@ import (
var ( var (
outputFile = flag.String("o", "out.png", "Image output filename") outputFile = flag.String("o", "out.png", "Image output filename")
font = flag.String("font", "serif", "Post font (options: \"serif\", \"sans\", \"mono\")") font = flag.String("font", "serif", "Post font (options: \"serif\", \"sans\", \"mono\")")
instance = flag.String("i", "write.as", "WriteFreely instance hostname (e.g. pencil.writefree.ly)") instance = flag.String("i", "write.as", "WriteFreely instance hostname (e.g. \"pencil.writefree.ly\")")
author = flag.String("u", "", "WriteFreely author username (for multi-user instances)") author = flag.String("u", "", "WriteFreely author username (for multi-user instances)")
size = flag.String("size", "1024", "Image size, either a single number for a square (e.g. \"900\") or a combined width and height (e.g. \"1080x1920\")") size = flag.String("size", "1024", "Image size, either a single number for a square (e.g. \"900\") or a combined width and height (e.g. \"1080x1920\")")
) )
@ -36,7 +36,7 @@ func main() {
// Validate input // Validate input
if !textpic.IsValidFont(*font) { if !textpic.IsValidFont(*font) {
log.Info("Invalid font given. Options: \"serif\", \"sans\", \"mono\"") log.Info("Invalid --font given. Options: \"serif\", \"sans\", \"mono\"")
os.Exit(1) os.Exit(1)
} }
// Parse image dimensions and validate // Parse image dimensions and validate