flip
is a Python-based command-line tool designed to invert the last two arguments of a specified command before executing it. This utility is particularly useful for commands like grep
, where you may want to search different strings in the same file multiple times.
- Inverts the last two arguments of a given command.
- Supports debug mode, activated with
-d
or--debug
, to print the executed command.
-
Clone the repository:
bashCopy code
git clone https://github.com/digitalw00t/flip.git
-
Navigate to the project directory:
bashCopy code
cd flip
-
Make the script executable:
bashCopy code
chmod +x flip.py
General usage:
bashCopy code
./flip.py [OPTIONS] COMMAND -- [ARGUMENTS]
-d
,--debug
: Enable debug mode to print the command that will be executed.
COMMAND
: The command you want to run.ARGUMENTS
: The arguments for the command.
Note: Use --
before specifying the arguments to ensure that any special characters like wildcards are handled correctly.
-
Basic Usage:
bashCopy code
./flip.py grep -- -ir file string
This will run:
grep -ir string file
-
With Debug Mode:
bashCopy code
./flip.py -d grep -- -ir file string
Output:
bashCopy code
Executing command: grep -ir string file
And then it will run the actual command.
Feel free to open issues or submit pull requests to improve the tool.
This project is open-sourced under the MIT License.
- 📘 Markdown Guide to get more familiar with Markdown syntax.
- 🛠️ Creating a README.md for more tips on writing README files.
- 📝 Technical Writing to improve your documentation skills.
- 🐍 Python CLI Projects for more examples of Python command-line tools.