<commit_before>#!/usr/bin/env node
const qr = require('qrcode-terminal')
const argv = require('minimist')(process.argv.slice(2), { string: '_' })
const generatePayload = require('./')
const target = String(argv._[0]).replace(/-/g, '')

if (!/^(0|66)\d{9}|\d{13}$/.test(target)) {
  console.error('Invalid recipient given: expected tax id or phone number')
  process.exit(1)
}

const payload = generatePayload(target, { amount: +argv._[1] })
console.log(payload)

qr.generate(payload, { small: !!argv.small })<commit_msg>:sparkles: Support --amount<commit_after>#!/usr/bin/env node
const qr = require('qrcode-terminal')
const argv = require('minimist')(process.argv.slice(2), { string: '_' })
const generatePayload = require('./')
const target = String(argv._[0]).replace(/-/g, '')

if (!/^(0|66)\d{9}|\d{13}$/.test(target)) {
  console.error('Invalid recipient given: expected tax id or phone number')
  process.exit(1)
}

const payload = generatePayload(target, { amount: +argv.amount || +argv._[1] })
console.log(payload)

qr.generate(payload, { small: !!argv.small })
{'fraction_non_alphanumeric': 0.20934579439252338, 'fraction_numerical': 0.018691588785046728, 'mean_word_length': 5.3, 'pattern_counts': {'":': 0, '<': 3, '<?xml version=': 0, '>': 3, 'https://': 0, 'lorem ipsum': 0, 'www.': 0, 'xml': 0}, 'pii_count': 0, 'substrings_counts': 0, 'word_list_counts': {'cursed_substrings.json': 0, 'profanity_word_list.json': 0, 'sexual_word_list.json': 0, 'zh_pornsignals.json': 0}}
{'dir': 'git-commits-cleaned', 'id': '5113175', 'n_tokens_mistral': 374, 'n_tokens_neox': 354, 'n_words': 75}