mirror of
https://github.com/caronc/apprise.git
synced 2024-12-13 10:21:51 +01:00
Updated CLI_Usage (markdown)
parent
e2f63ff44c
commit
035d9fb129
55
CLI_Usage.md
55
CLI_Usage.md
@ -70,12 +70,28 @@ Apprise makes this easy by simply allowing you to tag your URLs. There is no li
|
|||||||
# the URL, you just place an equal (=) sign and write the URL:
|
# the URL, you just place an equal (=) sign and write the URL:
|
||||||
#
|
#
|
||||||
# Syntax: <tags>=<url>
|
# Syntax: <tags>=<url>
|
||||||
|
|
||||||
|
# Here we set up a mailto:// URL and assign it the tags: me, and family
|
||||||
me,family=mailto://user:password@yahoo.com
|
me,family=mailto://user:password@yahoo.com
|
||||||
|
|
||||||
|
# Here we set up a mailto:// URL and assign it the tag: family
|
||||||
|
# In this example, we would email 2 people if triggered
|
||||||
family=mailto://user:password@yahoo.com/myspouse@example.com/mychild@example.com
|
family=mailto://user:password@yahoo.com/myspouse@example.com/mychild@example.com
|
||||||
team=slack://token_a/token_b/token_c/#devops
|
|
||||||
devops=slack://token_a/token_b/token_c/#build_status
|
# This might be our Slack Team Server targeting the #devops channel
|
||||||
|
# We assign it the tag: team
|
||||||
|
team=slack://token_a/token_b/token_c/#general
|
||||||
|
|
||||||
|
# Maybe our company has a special devops group too idling in another
|
||||||
|
# channel; we can add that to our list too and assign it the tag: devops
|
||||||
|
devops=slack://token_a/token_b/token_c/#devops
|
||||||
|
|
||||||
|
# Here we assign all of our colleagues the tags: team, and email
|
||||||
team,email=mailto://user:password@yahoo.com/john@mycompany.com/jack@mycompany.com/jason@mycompany.com
|
team,email=mailto://user:password@yahoo.com/john@mycompany.com/jack@mycompany.com/jason@mycompany.com
|
||||||
downloads=kodi://example.com
|
|
||||||
|
# Maybe we have home automation at home, and we want to notify our
|
||||||
|
# kodi box when stuff becomes available to it
|
||||||
|
mytv=kodi://example.com
|
||||||
```
|
```
|
||||||
|
|
||||||
Now there is a lot to ingest from the above, but here is a great (relatively simple) example of how you can use this:
|
Now there is a lot to ingest from the above, but here is a great (relatively simple) example of how you can use this:
|
||||||
@ -111,3 +127,36 @@ python apprise --title="Meeting this Friday" \
|
|||||||
--body="Guys, there is a meeting this Friday with our director." \
|
--body="Guys, there is a meeting this Friday with our director." \
|
||||||
--tag=team,email
|
--tag=team,email
|
||||||
```
|
```
|
||||||
|
|
||||||
|
There is a special reserved tag called `all`. `all` will match ALL of your entries regardless of what tag name you gave it. Use this with caution.
|
||||||
|
|
||||||
|
Here is another way of looking at it:
|
||||||
|
```bash
|
||||||
|
# assuming you got your configuration in place; tagging works like so:
|
||||||
|
notify -b "has TagA" --tag=TagA
|
||||||
|
notify -b "has TagA OR TagB" --tag=TagA --tag=TagB
|
||||||
|
|
||||||
|
# For each item you group with the same --tag value is AND'ed
|
||||||
|
notify -b "has TagA AND TagB" --tag="TagA, TagB"
|
||||||
|
notify -b "has (TagA AND TagB) OR TagC" --tag="TagA, TagB" --tag=TagC
|
||||||
|
```
|
||||||
|
|
||||||
|
### Testing Configuration and Tags
|
||||||
|
Once you've built your elaborate configuration file and assigned all your tags. You certainly won't want to notify everyone over and over again while you test it out. Don't worry, that's what **--dry-run** (**-d**) is for. You can use this to test your _tag logic_ out and not actually perform the notification.
|
||||||
|
```bash
|
||||||
|
# Test which services would have been notified if the tags team and email
|
||||||
|
# were activated:
|
||||||
|
python apprise --title="Meeting this Friday" \
|
||||||
|
--body="Guys, there is a meeting this Friday with our director." \
|
||||||
|
--tag=team,email \
|
||||||
|
--dry-run
|
||||||
|
```
|
||||||
|
|
||||||
|
If you use the `--dry-run` (`-d`) switch, then some rules don't apply. For one, the --body is not even a required option. The above could have been re-written like so:
|
||||||
|
```bash
|
||||||
|
# Test which services would have been notified if the tags team and email
|
||||||
|
# were activated:
|
||||||
|
python apprise --tag=team,email --dry-run
|
||||||
|
```
|
||||||
|
|
||||||
|
Happy notifying!
|
Loading…
Reference in New Issue
Block a user