aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/scripts/cheate
blob: ad3ad8e9d0f8e998b85027fac6474d60b22dd0ca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/bin/bash

nb_cheats=$(cheat -l | grep -w "$2" | grep -w $1 | wc -l)

if [ $nb_cheats -gt 1 ]; then
  echo "Please chose between the tags:"
  cheat -l | grep -w "$2" | grep -w $1 | awk '{print $3}'
  echo "Usage: $0 <name> <tag>"
  exit
fi
if [ -Z $2 ]; then
  cheat -e $1
else
  cheat -p $2 -e $1
fi