From 18a3f3f9b6b2feea4d46ca52521fc2def4aacba3 Mon Sep 17 00:00:00 2001 From: xero Date: Wed, 7 Jun 2023 12:54:32 -0400 Subject: [PATCH] =?UTF-8?q?fix(options):=20=F0=9D=93=AF=F0=9D=93=B2?= =?UTF-8?q?=F0=9D=94=81=20=F0=9D=93=AF=F0=9D=93=AA=F0=9D=93=B7=F0=9D=93=AC?= =?UTF-8?q?=F0=9D=94=82,=F0=9D=93=AF=F0=9D=93=B5=F0=9D=93=AA=F0=9D=93=B0?= =?UTF-8?q?=F0=9D=93=BC?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- README.md | 8 +++++--- sofancy | 12 ++++++++---- 2 files changed, 13 insertions(+), 7 deletions(-) diff --git a/README.md b/README.md index bc2dd16..e788ff1 100755 --- a/README.md +++ b/README.md @@ -45,16 +45,18 @@ wide You So Fancy __ῳɛıཞɖ ųŋıƈơɖɛ ʄƖɛҳıŋɠ? 😜__ ``` -usage: ./sofancy.js [-f (font) | -t] string +usage: sofancy [-f (font) | -t] string flags: -f|--font (font) : output in a single font -t|--titles : display titles in output examples: - /sofancy.js -f wide aesthetics + sofancy -f wide aesthetics aesthetics - /sofancy.js -t some string | fzf | xsel -i + sofancy -tf neon llamas | sed 's/neon.* /txt: /' +txt: ᒪᒪᗩᗰᗩᔕ + sofancy -t some string | fzf | xsel -i git commit -m "style(docs): $(sofancy -f bolditalic STYLIN)" ``` diff --git a/sofancy b/sofancy index 2544cfc..c1fed03 100755 --- a/sofancy +++ b/sofancy @@ -6,16 +6,18 @@ let argv = require('minimist-lite')(process.argv.slice(2)); let charmap,find,font,str='',titles=false; function usage() { - console.log(`usage: ./sofancy.js [-f (font) | -t] string + console.log(`usage: sofancy [-f (font) | -t] string flags: -f|--font (font) : output in a single font -t|--titles : display titles in output examples: - /sofancy.js -f wide aesthetics + sofancy -f wide aesthetics aesthetics - /sofancy.js -t some string | fzf | xsel -i + sofancy -tf neon llamas | sed 's/neon.* /txt: /' +txt: ᒪᒪᗩᗰᗩᔕ + sofancy -t some string | fzf | xsel -i git commit -m "style(docs): $(sofancy -f bolditalic STYLIN)" `) process.exit(); @@ -24,7 +26,9 @@ function setArgs() { (argv.f || argv.font) ? font=argv.f || argv.font : delete font; find=(font == undefined) ? /.*json$/ : `${font}.json`; titles=(argv.t || argv.titles) ? true : false; - if (argv.titles) { + if (argv.t && !font) { + str=argv.t+" "+argv._.toString().replace(',', ' '); + } else if (argv.titles && !font) { str=argv.titles+" "+argv._.toString().replace(',', ' '); } else { str=argv._.toString().replace(',', ' ');