diff --git a/README.md b/README.md index 0a800b7..dc955d2 100644 --- a/README.md +++ b/README.md @@ -10,9 +10,13 @@ Each QR Code contains error recovery information to aid reading damaged or obscu ## Install +To install both library and command-line tool `qrcode` (will be built into `$GOPATH/bin/`): + go get -u github.com/skip2/go-qrcode/... -A command-line tool `qrcode` will be built into `$GOPATH/bin/`. +To install just the command-line tool: + + go install github.com/skip2/go-qrcode/qrcode@latest ## Usage diff --git a/qrcode/main.go b/qrcode/main.go index a38731c..2465c60 100644 --- a/qrcode/main.go +++ b/qrcode/main.go @@ -16,6 +16,7 @@ func main() { outFile := flag.String("o", "", "out PNG file prefix, empty for stdout") size := flag.Int("s", 256, "image size (pixel)") textArt := flag.Bool("t", false, "print as text-art on stdout") + small := flag.Bool("small", false, "when -t is used, prints smaller text-art") negative := flag.Bool("i", false, "invert black and white") disableBorder := flag.Bool("d", false, "disable QR Code border") flag.Usage = func() { @@ -58,7 +59,12 @@ Usage: } if *textArt { - art := q.ToString(*negative) + var art string + if *small { + art = q.ToSmallString(*negative) + } else { + art = q.ToString(*negative) + } fmt.Println(art) return }