summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-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