magnickolas / inf

Minimalistic auto-refreshing compilation tool

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

inf

A generic helper script for monitoring compilation process.

When the source files are changed, it automatically refreshes output.

Dependencies

Installation

Either simply download the latest release:

wget https://github.com/magnickolas/inf/releases/latest/download/inf -O ~/.local/bin/inf && chmod +x ~/.local/bin/inf

Or download the latest version from master branch:

wget https://raw.githubusercontent.com/magnickolas/inf/main/inf -O ~/.local/bin/inf && chmod +x ~/.local/bin/inf

Or install it from source:

git clone https://github.com/magnickolas/inf
cd inf
make install prefix=~/.local exec=inf

Usage examples

  • Automatically rebuild and run a single file with provided input file
    • -v flag always prints the compiler's output (even on success); useful e.g. to see if there are warnings
inf -v -i input.txt -r ./a.out -- g++ -O2 main.cpp
  • If using make, we need to explicitly list the files that would trigger recompilation
    • -x flag interrupts the current running command and restart the whole process on source files change
inf -x -m src/*.cpp src/*.h -r "make run" make
  • We can use the compile phase to run some linter (in this case it's mypy for python)
    • -z flag is to print nothing but the output of the compile and run commands
inf -z -r "python3 main.py" mypy main.py

Notes

When -x | --refresh flag is passed, interactive shell is disabled due to technical reasons. If you want to enter some input, provide input file with -i | --input.

About

Minimalistic auto-refreshing compilation tool

License:MIT License


Languages

Language:Shell 95.3%Language:Makefile 4.7%