From e504ed5981dd2df69865ede16722c2e1632de774 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Mon, 23 Aug 2021 03:03:40 -0500 Subject: Add version command --- git-update-agent | 8 +++++++- 1 file changed, 7 insertions(+), 1 deletion(-) (limited to 'git-update-agent') diff --git a/git-update-agent b/git-update-agent index e932afe..af8a0df 100644 --- a/git-update-agent +++ b/git-update-agent @@ -199,6 +199,7 @@ Usage: ${PROGRAM} [OPTIONS]... --init-with initialize a project with the given URL --track track a git repository not initialized with $PROGRAM --disable-tracking disable tracking + --version output version _EOF } @@ -322,6 +323,10 @@ init_repo() { set +e } +print_version() { + echo "0.0.1" +} + # # API # @@ -353,7 +358,7 @@ git_update_agent() { shift if [[ $# -eq 0 ]]; then - die "--init requires an option" + die "--init-with requires an option" fi remote_url="$1" @@ -362,6 +367,7 @@ git_update_agent() { ;; --track) track=1; shift ;; --disable-tracking) disable_tracking=1; shift ;; + --version) print_version; exit 0 ;; *) die "$(print_usage)" ;; esac done -- cgit v1.2.3