sccash/sccash.1
2026-03-26 22:23:37 -04:00

157 lines
4.3 KiB
Groff

.TH SCCASH 1 "March 2026" "sccash 1.0" "User Commands"
.SH NAME
sccash \- Simple C Cash currency converter
.SH SYNOPSIS
.B sccash
.RI [ amount from_currency to_currency ]
.SH DESCRIPTION
.B sccash
is a lightweight, fast CLI currency converter written in C that supports
conversions between USD (US Dollar), JPY (Japanese Yen), and EUR (Euro).
.PP
The program operates in two modes:
.IP \(bu 2
.B Command-line mode:
Pass arguments directly for quick conversions and scripting
.IP \(bu 2
.B Interactive mode:
Run without arguments for guided prompts
.PP
All conversions are performed using USD as the base currency to minimize
rounding errors. Results are displayed in a clean table format with
2 decimal precision.
.SH ARGUMENTS
.TP
.B amount
The numeric value to convert. Must be a positive number.
.TP
.B from_currency
Source currency code. Accepted values: USD, JPY, EUR (case-insensitive).
.TP
.B to_currency
Target currency code. Accepted values: USD, JPY, EUR (case-insensitive).
.SH OPTIONS
.TP
.B \-\-help
Display usage information and exit.
.SH EXAMPLES
.TP
Convert 100 USD to JPY:
.B sccash 100 USD JPY
.TP
Convert 50 EUR to USD:
.B sccash 50 EUR USD
.TP
Convert 1000 JPY to EUR:
.B sccash 1000 JPY EUR
.TP
Start interactive mode:
.B sccash
.PP
Example output:
.PP
.nf
+--------+---------------+--------+----------------+
| FROM | AMOUNT | TO | CONVERTED |
+--------+---------------+--------+----------------+
| USD | 100.00 | JPY | 15967.00 |
+--------+---------------+--------+----------------+
.fi
.SH INTERACTIVE MODE
When run without arguments, sccash enters interactive mode and prompts for:
.IP 1. 4
Amount to convert
.IP 2. 4
Source currency (USD/JPY/EUR)
.IP 3. 4
Target currency (USD/JPY/EUR)
.IP 4. 4
Option to display all possible conversions from the source currency
.PP
Interactive mode is useful for one-off conversions and exploring different
conversion options.
.SH EXCHANGE RATES
The following exchange rates are hardcoded as of March 26, 2026:
.IP \(bu 2
1 USD = 159.67 JPY
.IP \(bu 2
1 USD = 0.866 EUR
.IP \(bu 2
1 EUR = 184.20 JPY
.PP
.B Important:
These rates are fixed and do not update automatically. They may not reflect
current market rates. This tool is designed for quick estimates and personal
use, not for financial trading or time-sensitive conversions.
.SH EXIT STATUS
.TP
.B 0
Successful conversion or help display
.TP
.B 1
Error occurred (invalid amount, invalid currency, or missing arguments)
.SH FILES
No configuration files are used. Exchange rates are compiled directly into
the binary.
.SH ENVIRONMENT
No environment variables are used.
.SH COMPILATION
To compile sccash from source:
.PP
.B gcc -o sccash sccash.c -Wall -O2
.PP
For a static binary:
.PP
.B gcc -o sccash sccash.c -Wall -O2 -static
.SH INSTALLATION
Install the binary to your local bin:
.PP
.B mkdir -p ~/bin && cp sccash ~/bin/
.PP
Or install system-wide:
.PP
.B sudo cp sccash /usr/local/bin/
.SH NOTES
Currency codes are case-insensitive. The following are all equivalent:
.BR USD ,
.BR usd ,
.BR Usd ,
.BR usD .
.PP
The program validates all inputs and provides clear error messages for:
.IP \(bu 2
Non-numeric or negative amounts
.IP \(bu 2
Invalid currency codes
.IP \(bu 2
Missing command-line arguments
.SH BUGS
The exchange rates are static and compiled into the binary. They do not
update automatically with market changes. For real-time currency conversion,
consider using a service with API integration.
.PP
Report bugs at: https://github.com/yourusername/sccash/issues
.SH SEE ALSO
.BR bc (1),
.BR units (1),
.BR convert (1)
.SH AUTHOR
Written by markmental (Mark Robillard Jr).
.SH COPYRIGHT
Copyright (C) 2026 markmental (Mark Robillard Jr).
.PP
This program is free software; you can redistribute it and/or modify
it under the terms of the GNU General Public License as published by
the Free Software Foundation; either version 2 of the License, or
(at your option) any later version.
.PP
This program is distributed in the hope that it will be useful,
but WITHOUT ANY WARRANTY; without even the implied warranty of
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
GNU General Public License for more details.
.PP
You should have received a copy of the GNU General Public License
along with this program; if not, write to the Free Software
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
.SH VERSION
sccash 1.0 (March 2026)