dotfiles

configurations and scripts
git clone https://riazj.com/git/dotfiles
Log | Files | Refs | LICENSE

tldr (295B)


      1 #!/bin/sh -e
      2 
      3 PAGES="$XDG_CACHE_HOME/tldr/pages"
      4 
      5 [ $# -eq 0 ] && { echo "usage: tldr command [platform]"; exit; }
      6 [ -d "$PAGES/$2" ] && page="$(find "$PAGES/$2" -name "$1.md" -exec cat {} \; -quit)"
      7 [ -n "$page" ] && { printf "%s\n" "$page"; exit; }
      8 
      9 printf "tldr: %s not found\n" "$1"; exit 1