summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorflu0r1ne <flu0r1ne@flu0r1ne.net>2021-08-23 03:03:40 -0500
committerflu0r1ne <flu0r1ne@flu0r1ne.net>2021-08-23 03:03:40 -0500
commite504ed5981dd2df69865ede16722c2e1632de774 (patch)
treef63f005c871fa1ab01586d81a43de68d2a1a13f0
parentdfecbd5b588c1fbdaacf3df8a0ab93a668c282d2 (diff)
downloaddeb-git-update-agent-e504ed5981dd2df69865ede16722c2e1632de774.tar.xz
deb-git-update-agent-e504ed5981dd2df69865ede16722c2e1632de774.zip
Add version command
-rw-r--r--Makefile4
-rw-r--r--git-update-agent8
2 files changed, 10 insertions, 2 deletions
diff --git a/Makefile b/Makefile
index 44d698a..d75c501 100644
--- a/Makefile
+++ b/Makefile
@@ -8,6 +8,8 @@ endif
CMD=git-update-agent
+make:
+
install:
mkdir -p $(DESTDIR)$(PREFIX)$(BINDIR)/
install -D -m 755 $(CMD) $(DESTDIR)$(PREFIX)$(BINDIR)/
@@ -15,4 +17,4 @@ install:
uninstall:
rm -rf $(DESTDIR)$(PREFIX)$(BINDIR)/$(CMD)
-.PHONY: install uninstall $(CMD)
+.PHONY: install uninstall make
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