🔧 Tips Code Structure
Main Script: tips.sh
- Loads config files and environment variables
- Loads
tipsFunctions.sh
- Parses command-line arguments via
getopts
- Calls mapped function based on argument (-a, -s, -u, -J, etc.)
Helper File: tipsFunctions.sh
add_record – Create a new record
update_record – Modify an existing record
search_records – Search by keyword
fuzzy_search – Regex-enabled search
title_only_search – Search in the title field
filter_by_category – Exact match on category
filter_by_tag – Partial match on tags
summary_search – Search using summary format
show_all_records – Print entire dataset
show_summary – Print summary format
tail_records – Show last N entries
edit_attachment, edit_datafile – Launches vi
convert_to_json, convert_to_yaml – Export structured formats
validate_records – Checks for malformed lines
generate_report – Runs optional report logic