@@ -6,16 +6,18 @@ let argv = require('minimist-lite')(process.argv.slice(2));
6
6
let charmap , find , font , str = '' , titles = false ;
7
7
8
8
function usage ( ) {
9
- console . log ( `usage: ./ sofancy.js [-f (font) | -t] string
9
+ console . log ( `usage: sofancy [-f (font) | -t] string
10
10
11
11
flags:
12
12
-f|--font (font) : output in a single font
13
13
-t|--titles : display titles in output
14
14
15
15
examples:
16
- / sofancy.js -f wide aesthetics
16
+ sofancy -f wide aesthetics
17
17
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
19
21
git commit -m "style(docs): $(sofancy -f bolditalic STYLIN)"
20
22
` )
21
23
process . exit ( ) ;
@@ -24,7 +26,9 @@ function setArgs() {
24
26
( argv . f || argv . font ) ? font = argv . f || argv . font : delete font ;
25
27
find = ( font == undefined ) ? / .* j s o n $ / : `${ font } .json` ;
26
28
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 ) {
28
32
str = argv . titles + " " + argv . _ . toString ( ) . replace ( ',' , ' ' ) ;
29
33
} else {
30
34
str = argv . _ . toString ( ) . replace ( ',' , ' ' ) ;
0 commit comments