From ceb12254be301bcc30c6346be72d886ed3f9aceb Mon Sep 17 00:00:00 2001 From: Jeremy Lecour Date: Fri, 29 Dec 2023 15:17:39 +0100 Subject: [PATCH] =?UTF-8?q?add=20simple=20bin=20script=20to=20show=20versi?= =?UTF-8?q?on=E2=80=A6?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- client/bin/evobackup | 31 +++++++++++++++++++++++++++++++ client/lib/main.sh | 19 +++++++++++++++++++ 2 files changed, 50 insertions(+) create mode 100644 client/bin/evobackup diff --git a/client/bin/evobackup b/client/bin/evobackup new file mode 100644 index 0000000..d9a1317 --- /dev/null +++ b/client/bin/evobackup @@ -0,0 +1,31 @@ +#!/bin/sh + +# Change this to wherever you install the libraries +LIBDIR="/usr/local/lib/evobackup" + +source "${LIBDIR}/main.sh" + +# Parse options, based on https://gist.github.com/deshion/10d3cb5f88a21671e17a +while :; do + case ${1:-''} in + -V|--version) + show_version + exit 0 + ;; + --) + # End of all options. + shift + break + ;; + -?*|[[:alnum:]]*) + # ignore unknown options + log_error "unknown option '${1}' (ignored)" + ;; + *) + # Default case: If no more options then break out of the loop. + break + ;; + esac + + shift +done diff --git a/client/lib/main.sh b/client/lib/main.sh index 7a1c831..b49a40b 100644 --- a/client/lib/main.sh +++ b/client/lib/main.sh @@ -18,6 +18,25 @@ source "${LIBDIR}/dump-mysql.sh" source "${LIBDIR}/dump-postgresql.sh" source "${LIBDIR}/dump-misc.sh" +show_version() { + cat <, + Gregory Colpart , + Romain Dessort , + Benoit Série , + Tristan Pilat , + Victor Laborie , + Jérémy Lecour + and others. + +evobackup comes with ABSOLUTELY NO WARRANTY. This is free software, +and you are welcome to redistribute it under certain conditions. +See the GNU General Public License v3.0 for details. +END +} + # Called from main, it is wrapping the local_tasks function defined in the real script local_tasks_wrapper() { log "START LOCAL_TASKS"