aboutsummaryrefslogtreecommitdiff
path: root/dotfiles/scripts/cheatv
blob: a3286fd055e0237d812615fdf75c8f5128cbbef8 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
#!/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

cheat_path=$(cheat -l | grep -w "$2" | grep -w $1 | awk '{print $2}')

~/bin/clima -p $cheat_path