diff options
author | Malf Furious <m@lfurio.us> | 2017-05-01 01:34:58 -0400 |
---|---|---|
committer | Malf Furious <m@lfurio.us> | 2017-05-01 01:34:58 -0400 |
commit | 05a46bd5b1bde9329a98f18c71596987916688b7 (patch) | |
tree | 311b5078aace4a0d935a4f0c26f973e5cbbcdbf6 /main.sh | |
parent | e8aa4a1d328eafd848b05636ba21aff90c11cee6 (diff) | |
download | systrunk-05a46bd5b1bde9329a98f18c71596987916688b7.tar.gz systrunk-05a46bd5b1bde9329a98f18c71596987916688b7.zip |
Rewrite main module
Diffstat (limited to 'main.sh')
-rw-r--r-- | main.sh | 31 |
1 files changed, 23 insertions, 8 deletions
@@ -13,15 +13,30 @@ function main exit fi - if [[ "$1" == "checkout" ]]; then - systr_checkout $@ - elif [[ "$1" == "status" ]]; then - systr_status $@ - elif [[ "$1" == "commit" ]]; then - systr_commit $@ + cmd="$1" + shift + + if [ $# -gt 1 ]; then + if [[ "$cmd" == "checkout" ]]; then + systr_checkout "$@" + exit + fi + fi + + read remote <.systr/remote + read path <.systr/path + read BASE <.systr/BASE + read TRAC <.systr/TRAC + + if [[ "$cmd" == "checkout" ]]; then + systr_checkout "$@" + elif [[ "$cmd" == "status" ]]; then + systr_status "$@" + elif [[ "$cmd" == "commit" ]]; then + systr_commit "$@" else - echo "Error: $1 not recognized" + echo "Fatal: $1 not recognized" fi } -main $@ +main "$@" |