Skip to content

Commit

Permalink
Merge branch 'main' of https://github.com/filak/MessyProps
Browse files Browse the repository at this point in the history
  • Loading branch information
filak committed Sep 26, 2024
2 parents 8f27780 + a6ac339 commit 4e6df54
Showing 1 changed file with 20 additions and 8 deletions.
28 changes: 20 additions & 8 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,7 +3,8 @@
Java properties files can get messy. With **props_check.py** script you can check the properties files.

The script might be useful for:
- checking local config files for new/obsolete keys - ie when upgrading to a new version
- checking for duplicate keys, comparing keys and values, locating keys in a local repository
- checking local config files for new/obsolete keys - ie when upgrading a SW instance to a new version
- checking messages*.properties for new/obsolete keys - -dtto-

## Installation
Expand Down Expand Up @@ -33,21 +34,32 @@ There are 3 commands/actions available:

$ py props_check.py sort --indir /messy_project/configs --output merged_configs.properties

### Compare two props files to check
### Compare two props files

- for differing keys:
- to check for differing keys:

$ py props_check.py compare messages_en.properties messages_cs.properties

- for differing keys and values:
- to check for differing keys and values:

$ py props_check.py compare new/config.properties old/config.properties --values

### Locate keys from a props file in a git repository
### Locate keys from a props file

$ py props_check.py locate config.properties /messy_project/repo --branch main --subdir src --filext java,jsp,vm
- in a git repository tree

$ py props_check.py locate config.properties /messy_project/repo --branch main --subdir src --filext java,jsp,vm

- in a git repository tree - include untracked files

$ py props_check.py locate config.properties /messy_project/repo --untracked

- in any directory

$ py props_check.py locate config.properties /messy_project/mydir --noindex

> A key is currently being located using **git grep** command - ie:
$ git grep -c "<key>" <branch> -- *.java *.vm
$ git grep -c "<key>" <branch> -- <subdir/>*.java <subdir/>*.vm
$ git grep -c [--untracked | --no-index] <key>
$ git grep -c <key> <branch> -- *.java *.vm
$ git grep -c <key> <branch> -- <subdir/>*.java <subdir/>*.vm

0 comments on commit 4e6df54

Please sign in to comment.