A command-line tool for displaying random Indonesian proverbs (peribahasa) with their meanings.
peribahasa retrieves and displays random Indonesian proverbs from a SQLite database. The tool intelligently tracks which proverbs have been displayed to ensure variety and automatically resets when all proverbs have been shown.
- Random proverb selection - Displays random Indonesian proverbs with their meanings
- Smart tracking - Keeps track of displayed proverbs to avoid repetition
- Multiple output formats - Supports both plain text and HTML output
- Automatic reset - Automatically resets usage tracking when all proverbs have been displayed
- Length filtering - Option to limit proverb length for specific use cases
- File output - Can output to files or stdout
- Color-coded terminal output - Enhanced readability with ANSI color codes
- Bash 5.2+
- sqlite3
git clone https://github.com/Open-Technology-Foundation/peribahasa.git
cd peribahasa
# Ensure the script is executable:
chmod +x peribahasaDisplay a random proverb in text format:
./peribahasa-f, --format FORMAT Output format: text|html (default: text)
-m, --maxlen LENGTH Maximum combined length of proverb and meaning
-o, --output FILENAME Output to file (default: /dev/stdout)
-R, --reset Reset all usage flags to unused state
-v, --verbose Enable verbose output
-q, --quiet Suppress verbose output (default)
-V, --version Display version information
-h, --help Display help message
Display proverb in HTML format:
peribahasa -f htmlOutput to a file with verbose logging:
peribahasa -v -o output.txtLimit proverb length to 100 characters:
peribahasa -m 100Reset all proverbs to unused:
peribahasa -RAda udang di balik batu
There is a hidden agenda or ulterior motive
<!-- peribahasa indonesia YYYY-MM-DD HH:MM -->
<div class='peribahasa'>“Ada udang di balik batu”</div>
<div class='artinya'>There is a hidden agenda or ulterior motive</div>The tool uses a SQLite database (peribahasa.db) with the following structure:
id- Unique identifierperibahasa- The Indonesian proverbartinya- The meaning/translationdipakai- Usage flag (0 = unused, 1 = used)
peribahasa expects to find the database in the same directory that it is located.
- The script queries the database for unused proverbs (where
dipakai=0) - If no unused proverbs exist, all are automatically reset to unused
- A random proverb is selected from the unused pool
- The proverb is displayed in the chosen format
- The proverb is marked as used in the database
Contributions are welcome! Please feel free to submit a Pull Request.
When contributing:
- Follow the BASH-CODING-STANDARD
- Test thoroughly with various inputs
- Update documentation as needed
- Ensure shellcheck compliance
GNU General Public License v3.0 - see LICENSE.
Gary Dean (Biksu Okusi)