fuck.bashrc: Added usage message to failure state

This commit is contained in:
Gregor Bückendorf 2019-05-17 23:57:17 +02:00
parent 5d1b1c30e0
commit 1f63e97472
2 changed files with 8 additions and 1 deletions

View file

@ -3,6 +3,9 @@ function fuck {
local nth_last=${1:-1}
if [[ "$nth_last" =~ ^[0-9]+$ ]]; then
sudo $(fc -ln -$nth_last -$nth_last)
else
echo "Usage: fuck [offset]"
return 1
fi
}