From 79e62092cf73e43248127239bd759f1c52d99b45 Mon Sep 17 00:00:00 2001 From: flu0r1ne Date: Sun, 22 Aug 2021 03:15:17 -0500 Subject: Organization --- git-update-agent | 39 +++++++++++++++++++-------------------- 1 file 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 -- cgit v1.2.3