From 4b55d07ed27ccd0465b3b6d9ae7907d715a1f2c1 Mon Sep 17 00:00:00 2001 From: Jarno Rankinen Date: Sat, 1 Aug 2020 10:04:12 +0300 Subject: [PATCH] Help text Display help text when no arguments are given --- snapsh | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/snapsh b/snapsh index f760d7a..14a6852 100755 --- a/snapsh +++ b/snapsh @@ -16,4 +16,17 @@ ## You should have received a copy of the GNU General Public License ## along with this program. If not, see . +help() { + printf "Usage: + snapsh [OPTIONS] + Options: +Exit codes: + 2 - Invalid arguments" +} + +# If no options are given, display help +if [[ "$#" -eq 0 ]]; then + help + exit 2 +fi