aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorHugo Osvaldo Barrera <hugo@barrera.io>2020-05-01 11:08:28 +0200
committerDrew DeVault <sir@cmpwn.com>2020-05-05 20:18:19 +0200
commit25a0130e81309bde06f7926e00f89af2bb6f73c1 (patch)
tree6a4274a4bd5633caed15ac0e5c23744ca587dc97
parent61d59180b875573f8fa42e084d8e66a6b12b61f3 (diff)
downloadsway-25a0130e81309bde06f7926e00f89af2bb6f73c1.tar.xz
grimshot: Show usage when on invalid command
Show the usage output when an invalid command is received. Otherwise things like `grimshot --help` save a screenshot, which is really unexpected and hurts users trying to remember the right commands / arguments.
-rwxr-xr-xcontrib/grimshot18
1 files changed, 15 insertions, 3 deletions
diff --git a/contrib/grimshot b/contrib/grimshot
index 028fd935..6b94cb44 100755
--- a/contrib/grimshot
+++ b/contrib/grimshot
@@ -30,11 +30,23 @@ ACTION=${1:-usage}
SUBJECT=${2:-screen}
FILE=${3:-$(getTargetDirectory)/$(date -Ins).png}
-if [ "$ACTION" = "usage" ] ; then
+if [ "$ACTION" != "save" ] && [ "$ACTION" != "copy" ] && [ "$ACTION" != "check" ]; then
echo "Usage:"
- echo " grimshot copy|save win|screen|output|area [FILE]"
- echo "Troubleshoot:"
+ echo " grimshot (copy|save) [win|screen|output|area] [FILE]"
echo " grimshot check"
+ echo " grimshot usage"
+ echo ""
+ echo "Commands:"
+ echo " copy: Copy the screenshot data into the clipboard."
+ echo " save: Save the screenshot to a regular file."
+ echo " check: Verify if required tools are installed and exit."
+ echo " usage: Show this message and exit."
+ echo ""
+ echo "Targets:"
+ echo " win: Currently active window."
+ echo " screen: All visible outputs."
+ echo " output: Currently active output."
+ echo " region: Manually select a region."
exit
fi