This example demonstrates how to add color print functions.
This example was generated with:
$ bashly init
# ... now edit src/bashly.yml to match the example ...
$ bashly add colors
$ bashly generate
# ... now edit src/root_command.sh ...
$ bashly generate
The bashly add colors
command, simply created the
src/lib/colors.sh file, with useful color functions that
will be automatically included in the generated script.
See the manually edited src/root_command.sh for usage examples.
name: colorly
help: Sample application that uses the color functions
version: 0.1.0
args:
- name: message
help: "Message to show [default: hello colors]"
message=${args[message]:-hello colors}
underlined "Message Received":
echo
echo " => $(green_bold "$message")"
echo " ==> $(red_bold "$message")"
echo " ===> $(blue_bold "$message")"
echo
Message Received:
=> hello colors
==> hello colors
===> hello colors
Message Received:
=> hello colors
==> hello colors
===> hello colors