1
0
Fork 0
mirror of https://github.com/ohmyzsh/ohmyzsh.git synced 2024-11-15 10:20:08 +00:00
ohmyzsh/plugins/qrcode/qrcode.plugin.zsh
Celestino Gomes e583648195
feat(qrcode): new plugin to generate qrcode via https://qrcode.show (#10247)
* feat(qrcode): new plugin to generate qrcode via https://qrcode.show

* code fix suggested by @JuniorJPDJ

* Update docs to clarify how to interact with it

Co-authored-by: Robby Russell <robby@planetargon.com>
2023-01-09 20:46:54 +00:00

17 lines
486 B
Bash

# Imported and improved from https://qrcode.show/, section SHELL FUNCTIONS
_qrcode_show_message() {
echo "Type or paste your text, add a new blank line, and press ^d"
}
qrcode () {
local input="$*"
[ -z "$input" ] && _qrcode_show_message && local input="@/dev/stdin"
curl -d "$input" https://qrcode.show
}
qrsvg () {
local input="$*"
[ -z "$input" ] && _qrcode_show_message && local input="@/dev/stdin"
curl -d "$input" https://qrcode.show -H "Accept: image/svg+xml"
}