This is a modern, minimal Bash project template that includes:
- A main CLI script using
getoptsfor option parsing. - Sourcing-capable sub-scripts placed in
lib/. - A small test harness that uses plain Bash (no external test frameworks required).
- A
Makefilewithtest,lint, andinstalltargets.
Quick start
-
Make the main script executable:
make install
-
Run the CLI help:
./bin/template.sh -h
-
Run tests:
make test
Files
bin/template.sh— main CLI script; uses positional subcommands. Subcommands live inlib/commands/and handle their owngetoptsparsing.lib/functions/helpers.sh— helper functions (meant to be sourced).lib/functions/tasks.sh— task functions (meant to be sourced).lib/commands/greet.sh—greetsubcommand (handles-noption).lib/commands/do-task.sh—do-tasksubcommand (handles-roption).tests/run_tests.sh— simple test harness (no external deps).Makefile— targets:install,test,lint,help.
Notes
- All documentation and inline descriptions are in English.
- The test harness is intentionally dependency-free so it runs on plain Bash.