From f4bca1586da41d5163d769a7eead48b685fea670 Mon Sep 17 00:00:00 2001 From: Jeremy Date: Thu, 4 Aug 2022 17:16:24 +1200 Subject: [PATCH] Added -C option + added warning function and more --- matrix-send | 29 +++++++++++++++++++++-------- 1 file changed, 21 insertions(+), 8 deletions(-) diff --git a/matrix-send b/matrix-send index 0c15e98..de36628 100755 --- a/matrix-send +++ b/matrix-send @@ -17,12 +17,16 @@ conf_error () { exit 2 } +warning () { + printf "\033[93;1mwarning:\033[0m $1\n" +} + vargrep () { printf "$2\n" | grep "$1" $3 } usage () { - printf "usage: matrix-send [-t type] [-c] [-h] [-V] message room\n" + printf "usage: matrix-send [-t type] [-C config] [-chV] message room\n" exit 1 } @@ -31,6 +35,7 @@ help () { matrix-send: send a message to a Matrix room Options: -t type: change default event type + -C config: use a custom configuration file -c: clear cached access tokens -h: show this help menu -V: show version and program information @@ -130,9 +135,6 @@ ClearCache () { Send () { curl -s -XPOST -d "{"'"'"msgtype"'"'":"'"'"$mtype"'"'", "'"'"body"'"'":"'"'"$message"'"'"}" "https://$server/_matrix/client/r0/rooms/%21$roomid/send/m.room.message?access_token=$token" - #cat <