rbx 573 B

123456789101112131415161718192021222324252627282930313233343536373839404142
  1. #!/usr/bin/env bash
  2. export RBXOPT
  3. rbx_options_trim()
  4. {
  5. RBXOPT="${RBXOPT## }"
  6. RBXOPT="${RBXOPT%% }"
  7. }
  8. rbx_options_append()
  9. {
  10. for param in "$@"
  11. do
  12. if [[ " ${RBXOPT} " != *" $param "* ]]
  13. then
  14. RBXOPT="${RBXOPT} $param"
  15. fi
  16. done
  17. rbx_options_trim
  18. }
  19. rbx_options_remove()
  20. {
  21. RBXOPT=" ${RBXOPT} "
  22. for param in "$@"
  23. do
  24. if [[ "${RBXOPT}" == *" $param "* ]]
  25. then
  26. RBXOPT="${RBXOPT// $param / }"
  27. fi
  28. done
  29. rbx_options_trim
  30. }
  31. rbx_clean_project_options()
  32. {
  33. if [[ -n "${PROJECT_RBXOPT}" ]]
  34. then
  35. unset PROJECT_RBXOPT
  36. fi
  37. }