From bcda7acbba9c4e4eaa76084edb2c80e27668aa6f Mon Sep 17 00:00:00 2001 From: cbreton Date: Mon, 20 Jan 2020 09:59:04 +0100 Subject: Add script to edit a cheatsheet by tag --- dotfiles/scripts/cheate | 15 +++++++++++++++ 1 file changed, 15 insertions(+) create mode 100755 dotfiles/scripts/cheate (limited to 'dotfiles/scripts/cheate') diff --git a/dotfiles/scripts/cheate b/dotfiles/scripts/cheate new file mode 100755 index 0000000..ad3ad8e --- /dev/null +++ b/dotfiles/scripts/cheate @@ -0,0 +1,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 " + exit +fi +if [ -Z $2 ]; then + cheat -e $1 +else + cheat -p $2 -e $1 +fi -- cgit v1.2.1