The CLI for BinaryRTS is developed in Python (>=3.8) and uses Poetry for package management.
The CLI uses ctags
and cscope
(optional) to
analyze C/C++ source files.
For Windows, the binaries should be put into src/binaryrts/bin
.
The cscope
binary (optional) is already available there, whereas an up-to-date pre-built ctags
binary can be
downloaded here.
To use the BinaryRTS CLI on Linux or macOS, install them as follows:
# ctags
# macOS
$ brew tap universal-ctags/universal-ctags
$ brew install --HEAD universal-ctags
# Linux
$ git clone https://github.com/universal-ctags/ctags.git
$ cd ctags
$ ./autogen.sh
$ ./configure --prefix=/where/you/want # defaults to /usr/local
$ make
$ make install # may require extra privileges depending on where to install
# cscope (optional)
# macOS
$ brew install cscope
# Linux
$ sudo apt install cscope
To install the Python package with poetry
, run:
$ poetry install
By default, Poetry will create a virtual environment in .venv
, where the binaryrts
is installed. You can simply run
the CLI via:
$ poetry run binaryrts
# or activate the virtual environment in the current shell
$ poetry shell
$ binaryrts
To execute the test suite, run:
$ poetry run pytest
To build a Python wheel package with poetry
, run:
$ poetry build
Building binaryrts (0.1.0)
- Building sdist
- Built binaryrts-0.1.0.tar.gz
- Building wheel
- Built binaryrts-0.1.0-py3-none-any.whl
You can then distribute the .whl
file to anywhere and install the wheel package with:
$ pip install --user binaryrts-0.1.0-py3-none-any.whl
Once the package is installed, the CLI can be used as follows:
$ binaryrts --help
Usage: binaryrts [OPTIONS] COMMAND [ARGS]...
BinaryRTS CLI
Options:
--install-completion Install completion for the current shell.
--show-completion Show completion for the current shell, to copy it or
customize the installation.
--help Show this message and exit.
Commands:
convert Convert test traces
select Select tests