Skip to content

Commit 18a3f3f

Browse files
committed
fix(options): 𝓯𝓲𝔁 𝓯𝓪𝓷𝓬𝔂,𝓯𝓵𝓪𝓰𝓼
1 parent f7d4a17 commit 18a3f3f

File tree

2 files changed

+13
-7
lines changed

2 files changed

+13
-7
lines changed

README.md

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -45,16 +45,18 @@ wide You So Fancy
4545
__ῳɛıཞɖ ųŋıƈơɖɛ ʄƖɛҳıŋɠ? 😜__
4646

4747
```
48-
usage: ./sofancy.js [-f (font) | -t] string
48+
usage: sofancy [-f (font) | -t] string
4949
5050
flags:
5151
-f|--font (font) : output in a single font
5252
-t|--titles : display titles in output
5353
5454
examples:
55-
/sofancy.js -f wide aesthetics
55+
sofancy -f wide aesthetics
5656
aesthetics
57-
/sofancy.js -t some string | fzf | xsel -i
57+
sofancy -tf neon llamas | sed 's/neon.* /txt: /'
58+
txt: ᒪᒪᗩᗰᗩᔕ
59+
sofancy -t some string | fzf | xsel -i
5860
git commit -m "style(docs): $(sofancy -f bolditalic STYLIN)"
5961
```
6062

sofancy

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -6,16 +6,18 @@ let argv = require('minimist-lite')(process.argv.slice(2));
66
let charmap,find,font,str='',titles=false;
77

88
function usage() {
9-
console.log(`usage: ./sofancy.js [-f (font) | -t] string
9+
console.log(`usage: sofancy [-f (font) | -t] string
1010
1111
flags:
1212
-f|--font (font) : output in a single font
1313
-t|--titles : display titles in output
1414
1515
examples:
16-
/sofancy.js -f wide aesthetics
16+
sofancy -f wide aesthetics
1717
aesthetics
18-
/sofancy.js -t some string | fzf | xsel -i
18+
sofancy -tf neon llamas | sed 's/neon.* /txt: /'
19+
txt: ᒪᒪᗩᗰᗩᔕ
20+
sofancy -t some string | fzf | xsel -i
1921
git commit -m "style(docs): $(sofancy -f bolditalic STYLIN)"
2022
`)
2123
process.exit();
@@ -24,7 +26,9 @@ function setArgs() {
2426
(argv.f || argv.font) ? font=argv.f || argv.font : delete font;
2527
find=(font == undefined) ? /.*json$/ : `${font}.json`;
2628
titles=(argv.t || argv.titles) ? true : false;
27-
if (argv.titles) {
29+
if (argv.t && !font) {
30+
str=argv.t+" "+argv._.toString().replace(',', ' ');
31+
} else if (argv.titles && !font) {
2832
str=argv.titles+" "+argv._.toString().replace(',', ' ');
2933
} else {
3034
str=argv._.toString().replace(',', ' ');

0 commit comments

Comments
 (0)