Skip to content

Commit

Permalink
disable-obsolete-lemma and single char short code option
Browse files Browse the repository at this point in the history
  • Loading branch information
potsky committed Apr 27, 2016
1 parent a2dc676 commit 8f2e8e7
Show file tree
Hide file tree
Showing 2 changed files with 16 additions and 3 deletions.
5 changes: 5 additions & 0 deletions README.md
Expand Up @@ -284,6 +284,11 @@ Use the [github issue tool](https://github.com/potsky/laravel-localization-helpe

## 6. Change Log

### v2.x.3

- new: adding possibility to disable check for obsolete lemmas ([#27](https://github.com/potsky/laravel-localization-helpers/pull/27))
- fix: Short-Option for "output-flat" and "php-file-extension" changed because the two-letter-code doesn't work ([#27](https://github.com/potsky/laravel-localization-helpers/pull/27))

### v2.x.2

- show obsolete lemma when it is in array ([#21](https://github.com/potsky/laravel-localization-helpers/issues/21))
Expand Down
Expand Up @@ -339,6 +339,13 @@ public function fire()
$welcome_lemmas = array_diff_key( $new_lemmas , $old_lemmas );
$already_lemmas = array_intersect_key( $old_lemmas , $new_lemmas );

// disable check for obsolete lemma and consolidate with already_lemmas
if ( $this->option( 'disable-obsolete-check' ) )
{
$already_lemmas = array_unique( $obsolete_lemmas + $already_lemmas );
$obsolete_lemmas = array();
}

ksort( $obsolete_lemmas );
ksort( $welcome_lemmas );
ksort( $already_lemmas );
Expand Down Expand Up @@ -667,10 +674,11 @@ protected function getOptions()
array( 'no-backup' , 'b' , InputOption::VALUE_NONE , 'Do not backup lang file (be careful, I am not a good coder)' ) ,
array( 'no-comment' , 'c' , InputOption::VALUE_NONE , 'Do not add comments in lang files for lemma definition' ) ,
array( 'no-date' , 'd' , InputOption::VALUE_NONE , 'Do not add the date of execution in the lang files' ) ,
array( 'no-obsolete' , 'o' , InputOption::VALUE_NONE , 'Do not write obsolete lemma' ) ,
array( 'output-flat' , 'of' , InputOption::VALUE_NONE , 'Output arrays are flat (do not use sub-arrays and keep dots in lemma)' ) ,
array( 'no-obsolete' , 'o' , InputOption::VALUE_NONE , 'Do not write obsolete lemma (obsolete lemma will be removed)' ) ,
array( 'output-flat' , 'w' , InputOption::VALUE_NONE , 'Output arrays are flat (do not use sub-arrays and keep dots in lemma)' ) ,
array( 'silent' , 's' , InputOption::VALUE_NONE , 'Use this option to only return the exit code (use $? in shell to know whether there are missing lemma or nt)' ) ,
array( 'php-file-extension' , 'ex' , InputOption::VALUE_OPTIONAL , 'PHP file extension' , 'php' ) ,
array( 'php-file-extension' , 'x' , InputOption::VALUE_OPTIONAL , 'PHP file extension' , 'php' ) ,
array( 'disable-obsolete-check' , 'z' , InputOption::VALUE_NONE , 'Use this option to disable check for obsolete lemmas (obsolete lemma will be kept)' ) ,
);
}

Expand Down

0 comments on commit 8f2e8e7

Please sign in to comment.