hardcodes is a utility for searching strings hardcoded by developers in programs. It uses a modular tokenizer that can handle comments, any number of backslashes & nearly any syntax you throw at it.
Yes, it is designed to process any syntax and following languages are officially supported:
with pip
pip3 install hardcodesor build from source
git clone https://github.com/s0md3v/hardcodes && cd hardcodes && python3 setup.py installFor Developers
The sample program below demonstrates usage of hardcodes library
The arguments lang and comments are optional. Their use is explained below in the user documentation section.
For Users
cli.py provides a grep-like command line interface to hardcodes library. You will need to install the library first to use it.
Find strings in a file
Find strings in a directory, recursively
Hide paths from output
Specify programming language
Specifying a language is optional and should be used only when the programming language of source is already known.
Specify comment behaviour
With -c option, you can specify
python cli.py -o /path/to/file.ext