diff options
| author | Daniel Byron <=> | 2015-07-20 01:07:39 +1000 |
|---|---|---|
| committer | Daniel Byron <=> | 2015-07-20 01:07:39 +1000 |
| commit | 63c632b02ec2a49232ca291687e130967522b5b8 (patch) | |
| tree | f8b0ca20438c37697b1b59a33b55c267fcbe072e | |
| parent | Changed command line interface. Still needs testing. (diff) | |
| download | schemer2-63c632b02ec2a49232ca291687e130967522b5b8.tar.xz schemer2-63c632b02ec2a49232ca291687e130967522b5b8.zip | |
Update readme, more tweaks to command line interface
| -rw-r--r-- | README.md | 9 | ||||
| -rw-r--r-- | main.go | 16 |
2 files changed, 15 insertions, 10 deletions
@@ -40,16 +40,16 @@ And it will be built in your GOPATH directory, in a subdirectory named 'bin'. To ## Usage #### Reading from terminal config and outputting to image -> schemer2 -in=xterm:$HOME/.Xresources -outputImage=out.png +> schemer2 -format xterm::img -in .Xresources -out image.png #### Reading from that image and outputting terminal config (lilyterm) -> schemer2 -in=img:out.png -out=lilyterm +> schemer2 -format img::lilyterm -in image.png #### Reading from Xresources and outputting in termite format -> schemer2 -in=xterm:$HOME/.Xresources -out=termite +> schemer2 -format xterm::termite -in .Xresources #### Getting colors from image, and outputting a new image -> schemer2 -in=img:old.png -outputImage=new.png +> schemer2 -format img::img -in image.png -out new.png ## Features @@ -69,6 +69,7 @@ And it will be built in your GOPATH directory, in a subdirectory named 'bin'. To ## Supported output formats +- Images (png) - Colours in just plain text (default) - Konsole - xterm/rxvt/aterm @@ -33,33 +33,37 @@ func usage() { func flags_usage() { usage() + inputs_outputs() flag.PrintDefaults() os.Exit(2) } -func main() { +func inputs_outputs() { inSupport := "Input formats:\n" outSupport := "Output formats:\n" for _, f := range formats { if f.output != nil { outSupport += strings.Join([]string{" ", f.friendlyName, ":", f.flagName, "\n"}, " ") - // Special case for img output - outSupport += " Image output : img\n" } + // Special case for img output + outSupport += " Image output : img\n" if f.input != nil { inSupport += strings.Join([]string{" ", f.friendlyName, ":", f.flagName, "\n"}, " ") } } + fmt.Print(inSupport, outSupport) +} - threshold = flag.Int("t", 50, "Threshold for minimum color difference (image input only)") +func main() { + threshold = flag.Int("threshold", 50, "Threshold for minimum color difference (image input only)") infile = flag.String("in", "", "Input file") outfile = flag.String("out", "", "File to write output to.") format_string = flag.String("format", "", "Format of input and output. Eg. 'image"+format_separator+"xterm'") minBrightness = flag.Int("minBright", 0, "Minimum brightness for colors (image input only)") maxBrightness = flag.Int("maxBright", 200, "Maximum brightness for colors (image input only)") - imageHeight = flag.Int("h", 1080, "Height of output image") - imageWidth = flag.Int("w", 1920, "Width of output image") + imageHeight = flag.Int("height", 1080, "Height of output image") + imageWidth = flag.Int("width", 1920, "Width of output image") flag.Usage = flags_usage flag.Parse() |