Wraps cli commands for use in python
Project description
Command Line System Function Runner
This package provides a command-line interface for running system commands with parsed options and arguments. It dynamically generates a function interface for any system command, allowing for easy execution and option handling.
Features
- Dynamic parsing of command options from
--helpoutput - Support for short and long option formats
- Piping input from standard input or command line argument
- Ability to list available options for a command
Installation
To install the package, clone the repository and install the dependencies:
git clone <repository-url>
cd <repository-directory>
pip install -r requirements.txt
Usage
Run the script with the following syntax:
python script_name.py <command> [ARGS]... [OPTIONS]
Arguments
command: The system command to runARGS: Additional arguments for the command (optional)
Options
-o, --option TEXT: Specify command options (can be used multiple times)-p, --pipe TEXT: Provide input to pipe to the command-P, --print-args: Print available options for the command--help: Show help message and exit
Examples
-
List available options for a command:
python script_name.py ls --print-args -
Run a command with options:
python script_name.py ls -o l -o a /home -
Pipe input to a command:
python script_name.py grep -o i -p "search text" search_pattern -
Use standard input:
echo "Hello, World!" | python script_name.py grep World
Note
This tool is designed for educational and development purposes. Use caution when running system commands, especially with elevated privileges.
Project details
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Filter files by name, interpreter, ABI, and platform.
If you're not sure about the file name format, learn more about wheel file names.
Copy a direct link to the current filters
File details
Details for the file mausify-0.0.2.tar.gz.
File metadata
- Download URL: mausify-0.0.2.tar.gz
- Upload date:
- Size: 15.0 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/6.8.0-45-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
39052193606ca18d067dd45ba0fdfa1da77c38ce7e96df650d33d059791c5e3b
|
|
| MD5 |
97779f46650514c9b373830be9f9a321
|
|
| BLAKE2b-256 |
fcffc6f141b2a7fd839a460f5dc7caf687e7f7bb3d6368d22b5dab106e2181b9
|
File details
Details for the file mausify-0.0.2-py3-none-any.whl.
File metadata
- Download URL: mausify-0.0.2-py3-none-any.whl
- Upload date:
- Size: 15.5 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: poetry/1.8.4 CPython/3.10.12 Linux/6.8.0-45-generic
File hashes
| Algorithm | Hash digest | |
|---|---|---|
| SHA256 |
44497d88475bb354407acb2ce9854a796a48ec17460149ef409d22bdcec76526
|
|
| MD5 |
93bbb22b434abfca6b0f155ea7996b61
|
|
| BLAKE2b-256 |
a887636039d4247f4b62e5eb55ee85754f3650e96024231bcde2e87e90c582c7
|