From baa5e87507c001299e12069b20488e6f04721926 Mon Sep 17 00:00:00 2001 From: Tyler Davis Date: Fri, 16 Aug 2024 17:49:18 +0000 Subject: bin: add verbose output to fetchgit --- .local/bin/fetchgit | 22 ++++++++++++++++++++++ .local/share/git/repolist | 2 ++ 2 files changed, 24 insertions(+) (limited to '.local') diff --git a/.local/bin/fetchgit b/.local/bin/fetchgit index 7ec1d32..a8be80f 100755 --- a/.local/bin/fetchgit +++ b/.local/bin/fetchgit @@ -1,5 +1,24 @@ #!/usr/bin/env sh +verbose=0 # Variables to be evaluated as shell arithmetic should be initialized to a default or validated beforehand. +while :; do + case $1 in + -v) + verbose=$((verbose + 1)) # Each -v argument adds 1 to verbosity. + ;; + --) # End of all options. + shift + break + ;; + -?*) + printf 'WARN: Unknown option (ignored): %s\n' "$1" >&2 + ;; + *) # Default case: If no more options then break out of the loop. + break ;; + esac + shift +done + CWD=$PWD if [ "$#" -gt 0 ]; then for d in "$@"; do @@ -8,6 +27,9 @@ if [ "$#" -gt 0 ]; then *) cd ${d} ;; esac + if [ $verbose -gt 0 ]; then + echo $PWD + fi if [ ! -d .git ]; then # If $PWD/.git doesn't exist # then are we in a ".git" dir? jump up one dir if [ ${PWD##*/} = ".git" ]; then diff --git a/.local/share/git/repolist b/.local/share/git/repolist index b5a6f55..fe5898a 100644 --- a/.local/share/git/repolist +++ b/.local/share/git/repolist @@ -1,6 +1,8 @@ cs631apue,origin=git@github.com:jschauma/cs631apue.git dark-mode-notify,origin=https://github.com/bouk/dark-mode-notify.git +housecat,origin=https://github.com/mortie/housecat.git hut,origin=https://git.sr.ht/~xenrox/hut journal,origin=git@git.sr.ht:~tydavis/journal +luapress,origin=https://github.com/Fizzadar/Luapress.git newsraft,origin=git@git.sr.ht:~tydavis/newsraft,upstream=https://codeberg.org/newsraft/newsraft.git resume,origin=git@git.sr.ht:~tydavis/resume -- cgit v1.2.3