diff options
author | cbreton <corentin.breton@fullsave.com> | 2020-01-20 09:58:18 +0100 |
---|---|---|
committer | cbreton <corentin.breton@fullsave.com> | 2020-01-20 09:58:18 +0100 |
commit | ec1a06dca4f3b2caf4f4cad1e6a0b38ff6a29d46 (patch) | |
tree | 81e95e7ad29c33c14f6dc2b80b909894c582123f | |
parent | acec98e1e4b1f5790820e64fc01f1b6fe2d028a0 (diff) | |
download | dotfiles-ec1a06dca4f3b2caf4f4cad1e6a0b38ff6a29d46.tar.xz dotfiles-ec1a06dca4f3b2caf4f4cad1e6a0b38ff6a29d46.zip |
[cheat] Add warning to choose the tags when multi tags
Diffstat (limited to '')
-rwxr-xr-x | dotfiles/scripts/cheatv | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/dotfiles/scripts/cheatv b/dotfiles/scripts/cheatv index b052dfe..a3286fd 100755 --- a/dotfiles/scripts/cheatv +++ b/dotfiles/scripts/cheatv @@ -1,5 +1,14 @@ #!/bin/bash -cheat_path=$(cheat -l | grep $1 | awk '{print $2}') +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 |