From cbd1e505dc33524b534f06d5de916da90bb7d854 Mon Sep 17 00:00:00 2001 From: abs3nt Date: Mon, 7 Oct 2024 18:48:43 -0700 Subject: [PATCH] better --- functions/repo.zsh | 40 ++++++++++++---------------------------- 1 file changed, 12 insertions(+), 28 deletions(-) diff --git a/functions/repo.zsh b/functions/repo.zsh index 063115c..942fcc0 100644 --- a/functions/repo.zsh +++ b/functions/repo.zsh @@ -1,31 +1,15 @@ repo() { - case "$1" in - 'get' ) - repo_get "$2" - ;; - 'open' ) - repo_open - ;; - 'aur' ) - repo_aur "$2" - ;; - 'list' ) - list_repos - ;; - 'go' | 'goto') - repo_goto "$2" - ;; - 'new' | 'create') - repo_new "$2" - ;; - 'help' | "-h" | "-help" | "--help") - repo_help - ;; - * ) - echo "Unknown command: $1" - repo_help - return 1 - ;; + local cmd="$1" + local arg="$2" + + case "$cmd" in + 'get' ) repo_clone "git" "$arg" ;; + 'aur' ) repo_clone "aur" "$arg" ;; + 'open') repo_open ;; + 'list') list_repos ;; + 'go' | 'goto') repo_goto "$arg" ;; + 'new' | 'create') repo_new "$arg" ;; + 'help' | "-h" | "-help" | "--help") repo_help ;; + *) echo "Unknown command: $cmd"; repo_help; return 1 ;; esac } -