diff --git a/README b/README index dcbc78e..60fe979 100644 --- a/README +++ b/README @@ -2,3 +2,10 @@ git-crap ======== Let's git some free crap! These scripts are sort of inspired by git-send-email & co. + +* git-send-paste + * Depends on nc(1) + * It assumes a termbin instance is running on port 9999 + +* git-send-xmpp + * Depends on xmppc (git@codeberg.org:Anoxinon_e.V./xmppc) \ No newline at end of file diff --git a/git-send-xmpp b/git-send-xmpp index ffe8989..67c8700 100644 --- a/git-send-xmpp +++ b/git-send-xmpp @@ -1,5 +1,5 @@ #!/bin/sh -# $KyokoNet: git-send-xmpp, v0.0.1 2022/11/11 22:14:55 akoizumi Exp $ +# $KyokoNet: git-send-xmpp, v0.0.2 2022/11/13 22:14:55 akoizumi Exp $ # # Send git patches over the XMPP protocol # https://git.kyoko-project.wer.ee/koizumi.aoi/git-crap @@ -14,9 +14,9 @@ EOF for arg; do case $arg in -h) usage ;; - --pass=*) XMPPBRIDGE_PASSWORD="${arg#*=}" ;; - --user=*) XMPPBRIDGE_JID="${arg#*=}" ;; - --target=*) XMPPBRIDGE_PEER_JID="${arg#*=}" ;; + --pass=*) pass="${arg#*=}" ;; + --user=*) user="${arg#*=}" ;; + --target=*) target="${arg#*=}" ;; --diff=*) diff="${arg#*=}" ;; *-*) printf "Unknown option %s\n" "$arg" ;; *=*) export "${arg:?}" ;; @@ -24,13 +24,10 @@ for arg; do esac done -if [ -z $XMPPBRIDGE_PASSWORD && -z $XMPPBRIDGE_JID && -z $XMPPBRIDGE_PEER_JID && -z $diff ]; then +if [ -z $pass && -z $user && -z $target && -z $diff ]; then usage exit 1 else - printf "Sending patch file %s to recipient %s over XMPP\n" "${diff}" "${XMPPBRIDGE_PEER_JID}" - export XMPPBRIDGE_JID - export XMPPBRIDGE_PASSWORD - export XMPPBRIDGE_PEER_JID - cat $diff | xmppbridge + printf "Sending patch file %s to recipient %s over XMPP\n" "${diff}" "${target}" + cat $diff | xmppc --jid ${user} --pwd ${pass} -m message chat ${target} fi