-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathflags.go
More file actions
30 lines (25 loc) · 983 Bytes
/
flags.go
File metadata and controls
30 lines (25 loc) · 983 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
package main
import (
"fmt"
"os"
"github.com/spf13/pflag"
)
var (
helpFlag = pflag.BoolP("help", "h", false, "Print help message")
versionFlag = pflag.Bool("version", false, "Print version")
listCharsFlag = pflag.BoolP("list-characters", "L", false, "List all available characters")
quietFlag = pflag.BoolP("quiet", "q", false, "Be quiet and disable spinner")
outputFlag = pflag.StringP("output", "o", "sticker.png", "Output image (- = stdout)")
textFontSizeFlag = pflag.Float64("text-font-size", 36, "Text font size")
textXFlag = pflag.Float64("text-x", 148, "Text X position")
textYFlag = pflag.Float64("text-y", 58, "Text Y position")
textRotationFlag = pflag.Float64("text-rotation", -0.2, "Text rotation in radians")
)
func init() {
pflag.Usage = func() {
fmt.Fprintf(os.Stderr, "Usage: %s [options] character text\n\n", os.Args[0])
fmt.Fprintln(os.Stderr, "Options:")
pflag.PrintDefaults()
}
pflag.Parse()
}