diff options
-rw-r--r-- | git-update-agent | 39 |
1 files changed, 19 insertions, 20 deletions
diff --git a/git-update-agent b/git-update-agent index ec3916e..6c205a7 100644 --- a/git-update-agent +++ b/git-update-agent @@ -190,6 +190,21 @@ $PROGRAM --track _EOF } +print_usage() { +cat <<_EOF +Usage: ${PROGRAM} [OPTIONS]... + -h, --help output this help info + -d, --dir update in directory + --init initialize a project with the given URL + --track track a git repository not initialized with $PROGRAM + --disable-tracking disable tracking +_EOF +} + +# +# SUBCOMMANDS +# + set_tracking() { local dir dir="$1" @@ -208,16 +223,6 @@ _EOF set_should_track "$2" } -disable_tracking() { - local dir - dir="$1" - - cd_or_die "$dir" - in_git_or_die - - set_should_track false -} - update() { local dir local previous_version @@ -261,16 +266,6 @@ update() { fi } -print_usage() { -cat <<_EOF -Usage: ${PROGRAM} [OPTIONS]... - -h, --help output this help info - -d, --dir update in directory - --init initialize a project with the given URL - --track track a git repository not initalized with $PROGRAM - --disable-tracking disable tracking -_EOF -} init_repo() { local remote @@ -313,6 +308,10 @@ init_repo() { set +e } +# +# API +# + git_update_agent() { local dir local option |