ropipe/README.md

104 lines
2.0 KiB
Markdown
Raw Normal View History

2024-07-07 15:40:42 +02:00
2021-10-06 17:50:47 +02:00
# Ropipe
2021-10-18 09:00:27 +02:00
2024-07-07 15:40:42 +02:00
![License](https://img.shields.io/github/license/MatMasIt/ropipe)
![c](https://img.shields.io/badge/language-C-blue)
> Convert Roman numbers to integers and vice-versa in pipes.
2021-10-18 09:00:27 +02:00
2021-10-06 17:50:47 +02:00
## What is ropipe?
2024-07-07 15:40:42 +02:00
Ropipe converts base-10 integers to Roman numbers and vice versa, reading from stdin and printing to stdout. It is designed to be used primarily in pipes. By default, it converts integers to Roman numbers.
## Options
- `-r`: Roman to integer conversion. Integer to Roman is the default behavior.
- `-h`: Display help message and exit.
- `-s`: Fail silently, with no output on invalid input.
- `-q`: Accept quirky Roman numerals like IIII for IV.
- `-k`: Don't quit on invalid input; continue processing subsequent inputs.
You can use the options concatenated, like `-rsk` or individually, like `-r -s -k`.
2021-10-06 17:50:47 +02:00
## Installation
2021-10-11 11:24:13 +02:00
2024-07-07 15:40:42 +02:00
1. Clone this repository:
```sh
git clone https://github.com/MatMasIt/ropipe.git
cd ropipe
```
2. Compile and install:
```sh
sudo make install
```
or
```sh
doas make install
```
The program is compiled during installation. You may review the script and the program before proceeding.
2021-10-06 17:50:47 +02:00
## Examples
2024-07-07 15:40:42 +02:00
Once installed, you can use `ropipe` in your shell commands. Below are some examples:
2021-10-06 17:54:41 +02:00
---
2024-07-07 15:40:42 +02:00
**Example 1:**
2021-10-06 17:50:47 +02:00
```sh
ropipe < arabic.txt
```
2024-07-07 15:40:42 +02:00
**Result:**
2021-10-06 17:54:41 +02:00
```
I
X
CXXIII
CCCXXI
```
---
2024-07-07 15:40:42 +02:00
**Example 2:**
2021-10-06 17:50:47 +02:00
```sh
ropipe -r < roman.txt
```
2024-07-07 15:40:42 +02:00
**Result:**
2021-10-06 17:54:41 +02:00
```
4
5
7
1200
```
2024-07-07 15:40:42 +02:00
2021-10-06 17:50:47 +02:00
## Manpage
2024-07-07 15:40:42 +02:00
A manpage is installed alongside the program. You can access it by running:
```sh
man ropipe
```
2021-10-06 17:50:47 +02:00
## Updates
2024-07-07 15:40:42 +02:00
There is no automatic update system currently implemented. Please visit [ropipe GitHub repository](https://github.com/MatMasIt/ropipe) regularly to check for updates. To update, download the latest version and re-run the installer.
Nontheless, it's not a program that one would expect to change often, so manual updates should be rare.
2021-10-11 11:24:13 +02:00
## Make commands
2024-07-07 15:40:42 +02:00
- `make`: compile ropipe
- `make install`: install ropipe
- `make uninstall`: uninstall ropipe