cached.sh.skel 470B

12345678910111213141516171819202122
  1. #!/bin/bash
  2. shellfu import pretty
  3. cached() {
  4. #
  5. # Get cached or new output of command $@
  6. #
  7. # Usage:
  8. # cached [-m] [-e|-E] [-o|-O] [-d|-D] CMD [ARG]
  9. #
  10. # Look up CMD with any ARGs in local cache and return result on hit.
  11. # In case of miss, run command to create the cache first.
  12. #
  13. # Specify -m to enforce cache miss, ie. as if CMD is run for the first
  14. # time.
  15. #
  16. :
  17. }
  18. #shellfu module-version=__MKIT_PROJ_VERSION__