shell dot on steroids https://pagure.io/shellfu

ffmanage.in 1.1KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253
  1. #!/bin/bash
  2. . __FFOO_DIR__/ffoo.sh
  3. ffoo import core
  4. usage() {
  5. usage_is "[-d] --list-modules" \
  6. "[-d] --list-functions [module]" \
  7. "[-d] --library-init" \
  8. "[-d] --version"
  9. }
  10. version_info() {
  11. echo "$(basename $0) (Fast Foo bash library) $FFOO_VERSION"
  12. echo
  13. echo "install path: __FFOO_DIR__"
  14. echo "data path: $FFOO_DATA_DIR"
  15. }
  16. while true; do case $1 in
  17. -d|--debug)
  18. FFOO_DEBUG=true;
  19. shift;
  20. ;;
  21. --library-init)
  22. echo "__FFOO_DIR__/ffoo.sh"
  23. exit 0
  24. ;;
  25. --list-modules)
  26. ffoo _list_all_modules
  27. exit $?
  28. ;;
  29. --list-functions)
  30. if test -n "$2";
  31. then
  32. ffoo _list_functions_in_mfile $(ffoo _list_mfiles_like $2)
  33. exit $?
  34. else
  35. ffoo _list_all_functions
  36. exit $?
  37. fi
  38. ;;
  39. --version)
  40. version_info
  41. exit 0
  42. ;;
  43. "")
  44. usage
  45. ;;
  46. esac;
  47. done