Working Saturnin-based meta-command

saturnin_demo_greet.sh 488B

12345678910111213141516171819202122232425262728
  1. #!/bin/bash
  2. shellfu import pretty
  3. #
  4. # Greet something
  5. #
  6. # This is an example Shellfu/Bash module. The purpose is to demonstrate
  7. # how a simple Shellfu/Bash module could look like.
  8. #
  9. saturnin_demo_greet__world() {
  10. #
  11. # Greet the world
  12. #
  13. think "greeting the world"
  14. echos "Hello, world!"
  15. }
  16. saturnin_demo_greet__user() {
  17. #
  18. # Greet user $1 or $USER
  19. #
  20. local user=${1:-$USER}
  21. debug -v user
  22. think "greeting user: $user"
  23. echos "Hello, $user!"
  24. }