@@ -6,16 +6,18 @@ let argv = require('minimist-lite')(process.argv.slice(2));
66let charmap , find , font , str = '' , titles = false ;
77
88function 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
1717aesthetics
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 ) ? / .* j s o n $ / : `${ 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