Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
6 changes: 5 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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

Expand Down
8 changes: 7 additions & 1 deletion qrcode/main.go
Original file line number Diff line number Diff line change
Expand Up @@ -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() {
Expand Down Expand Up @@ -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
}
Expand Down