File tree Expand file tree Collapse file tree 6 files changed +163
-156
lines changed
Expand file tree Collapse file tree 6 files changed +163
-156
lines changed Original file line number Diff line number Diff line change 11# Changelog
22
3+ ## v4.1.0
4+ - Вывод только безопасных замен с помощью CLI-параметра ` --only-safe ` вместе с ` --lint ` .
5+ - Обновлены зависимости в package.json.
6+
37## v4.0.1
48Обновлены зависимости в package.json.
59
Original file line number Diff line number Diff line change @@ -32,6 +32,7 @@ Options:
3232 -V, --version Output the version number
3333 -l, --lint Search of safe and unsafe replacements
3434 -s, --sort Sort results
35+ --only-safe Output only safe replacements
3536 --stdin Process text provided on <STDIN>
3637 --stdin-filename <file> Specify filename to process STDIN as
3738 --no-colors Clean output without colors
Original file line number Diff line number Diff line change @@ -11,6 +11,7 @@ program
1111 . version ( require ( '../package.json' ) . version )
1212 . usage ( '[options] <file-or-url...>\n\n Restoring the letter “ё” (yo) in russian texts.' )
1313 . option ( '-l, --lint' , 'Search of safe and unsafe replacements' )
14+ . option ( '--only-safe' , 'Output only safe replacements' )
1415 . option ( '-s, --sort' , 'Sort results' )
1516 . option ( '--no-colors' , 'Clean output without colors' )
1617 . option ( '--stdin' , 'Process text provided on <STDIN>' )
Original file line number Diff line number Diff line change @@ -91,10 +91,12 @@ module.exports = {
9191 }
9292 }
9393
94- const notSafeReplacement = notSafeEyo . lint ( text , program . sort ) ;
95- if ( notSafeReplacement . length ) {
96- console . log ( chalk . red ( ( notSafeReplacement . length ? '\n' : '' ) + 'Not safe replacements:' ) ) ;
97- notSafeReplacement . forEach ( printItem . bind ( this , 'yellow' ) ) ;
94+ if ( ! program . onlySafe ) {
95+ const notSafeReplacement = notSafeEyo . lint ( text , program . sort ) ;
96+ if ( notSafeReplacement . length ) {
97+ console . log ( chalk . red ( ( notSafeReplacement . length ? '\n' : '' ) + 'Not safe replacements:' ) ) ;
98+ notSafeReplacement . forEach ( printItem . bind ( this , 'yellow' ) ) ;
99+ }
98100 }
99101 } else {
100102 process . stdout . write ( safeEyo . restore ( text ) ) ;
You can’t perform that action at this time.
0 commit comments