]> git.corax.cc Git - foundry/commitdiff
watchbot: Rename option "topic" to "publish-to"
authorMatthias Kruk <m@m10k.eu>
Fri, 26 Nov 2021 12:38:08 +0000 (21:38 +0900)
committerMatthias Kruk <m@m10k.eu>
Fri, 26 Nov 2021 12:38:08 +0000 (21:38 +0900)
To make the usage of options more uniform across all foundry bots,
bots must read the name of the topic for outgoing messages from the
"publish-to" option.
This commit renames the "topic" option of watchbot to "publish-to".

watchbot.sh

index 497153be67631a232779d23cee461b80e8766458..a373ce86fb544b92265fc2628f4bd38986729ec3 100755 (executable)
@@ -203,12 +203,12 @@ _watch() {
 main() {
        local watchlist
        local interval
-       local topic
+       local publish_to
 
        opt_add_arg "r" "repository" "rv" ""          \
                    "Repository to watch for updates" \
                    "" _add_to_watchlist
-       opt_add_arg "t" "topic"      "v"  "commits"   \
+       opt_add_arg "p" "publish-to" "v"  "commits"   \
                    "Topic to publish notifications"
        opt_add_arg "i" "interval"   "v"  30          \
                    "Update check interval" "^[0-9]+$"
@@ -219,10 +219,10 @@ main() {
                return 1
        fi
 
-       topic=$(opt_get "topic")
+       publish_to=$(opt_get "publish-to")
        interval=$(opt_get "interval")
 
-       inst_start _watch "$topic" "$interval" "${watchlist[@]}"
+       inst_start _watch "$publish_to" "$interval" "${watchlist[@]}"
 
        return 0
 }