Skip to content

Commit

Permalink
CLI Configuration file support .conf added + doc ambiguity cleanup (#…
Browse files Browse the repository at this point in the history
  • Loading branch information
caronc committed Mar 9, 2024
1 parent d5cbab1 commit de1cb52
Show file tree
Hide file tree
Showing 3 changed files with 32 additions and 33 deletions.
32 changes: 12 additions & 20 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -232,43 +232,35 @@ No one wants to put their credentials out for everyone to see on the command lin
# By default if no url or configuration is specified apprise will attempt to load
# configuration files (if present) from:
# ~/.apprise
# ~/.apprise.yml
# ~/.apprise.yaml
# ~/.config/apprise
# ~/.config/apprise.yml
# ~/.config/apprise.conf
# ~/.config/apprise.yaml
# /etc/apprise
# /etc/apprise.yml
# /etc/apprise.conf
# /etc/apprise.yaml

# Also a subdirectory handling allows you to leverage plugins
# ~/.apprise/apprise
# ~/.apprise/apprise.yml
# ~/.apprise/apprise.yaml
# ~/.config/apprise/apprise
# ~/.config/apprise/apprise.yml
# ~/.config/apprise/apprise.conf
# ~/.config/apprise/apprise.yaml
# /etc/apprise/apprise
# /etc/apprise/apprise.yml
# /etc/apprise/apprise.yaml
# /etc/apprise/apprise.conf

# Windows users can store their default configuration files here:
# %APPDATA%/Apprise/apprise
# %APPDATA%/Apprise/apprise.yml
# %APPDATA%/Apprise/apprise.conf
# %APPDATA%/Apprise/apprise.yaml
# %LOCALAPPDATA%/Apprise/apprise
# %LOCALAPPDATA%/Apprise/apprise.yml
# %LOCALAPPDATA%/Apprise/apprise.conf
# %LOCALAPPDATA%/Apprise/apprise.yaml
# %ALLUSERSPROFILE%\Apprise\apprise
# %ALLUSERSPROFILE%\Apprise\apprise.yml
# %ALLUSERSPROFILE%\Apprise\apprise.conf
# %ALLUSERSPROFILE%\Apprise\apprise.yaml
# %PROGRAMFILES%\Apprise\apprise
# %PROGRAMFILES%\Apprise\apprise.yml
# %PROGRAMFILES%\Apprise\apprise.conf
# %PROGRAMFILES%\Apprise\apprise.yaml
# %COMMONPROGRAMFILES%\Apprise\apprise
# %COMMONPROGRAMFILES%\Apprise\apprise.yml
# %COMMONPROGRAMFILES%\Apprise\apprise.conf
# %COMMONPROGRAMFILES%\Apprise\apprise.yaml

# The configuration files specified above can also be identified with a `.yml`
# extension or even just entirely removing the `.conf` extension altogether.

# If you loaded one of those files, your command line gets really easy:
apprise -vv -t 'my title' -b 'my notification body'

Expand Down
12 changes: 11 additions & 1 deletion apprise/cli.py
Original file line number Diff line number Diff line change
Expand Up @@ -67,25 +67,30 @@
DEFAULT_CONFIG_PATHS = (
# Legacy Path Support
'~/.apprise',
'~/.apprise.conf',
'~/.apprise.yml',
'~/.apprise.yaml',
'~/.config/apprise',
'~/.config/apprise.conf',
'~/.config/apprise.yml',
'~/.config/apprise.yaml',

# Plugin Support Extended Directory Search Paths
'~/.apprise/apprise',
'~/.apprise/apprise.conf',
'~/.apprise/apprise.yml',
'~/.apprise/apprise.yaml',
'~/.config/apprise/apprise',
'~/.config/apprise/apprise.conf',
'~/.config/apprise/apprise.yml',
'~/.config/apprise/apprise.yaml',

# Global Configuration Support
# Global Configuration File Support
'/etc/apprise',
'/etc/apprise.yml',
'/etc/apprise.yaml',
'/etc/apprise/apprise',
'/etc/apprise/apprise.conf',
'/etc/apprise/apprise.yml',
'/etc/apprise/apprise.yaml',
)
Expand All @@ -104,9 +109,11 @@
# Default Config Search Path for Windows Users
DEFAULT_CONFIG_PATHS = (
expandvars('%APPDATA%\\Apprise\\apprise'),
expandvars('%APPDATA%\\Apprise\\apprise.conf'),
expandvars('%APPDATA%\\Apprise\\apprise.yml'),
expandvars('%APPDATA%\\Apprise\\apprise.yaml'),
expandvars('%LOCALAPPDATA%\\Apprise\\apprise'),
expandvars('%LOCALAPPDATA%\\Apprise\\apprise.conf'),
expandvars('%LOCALAPPDATA%\\Apprise\\apprise.yml'),
expandvars('%LOCALAPPDATA%\\Apprise\\apprise.yaml'),

Expand All @@ -116,16 +123,19 @@

# C:\ProgramData\Apprise\
expandvars('%ALLUSERSPROFILE%\\Apprise\\apprise'),
expandvars('%ALLUSERSPROFILE%\\Apprise\\apprise.conf'),
expandvars('%ALLUSERSPROFILE%\\Apprise\\apprise.yml'),
expandvars('%ALLUSERSPROFILE%\\Apprise\\apprise.yaml'),

# C:\Program Files\Apprise
expandvars('%PROGRAMFILES%\\Apprise\\apprise'),
expandvars('%PROGRAMFILES%\\Apprise\\apprise.conf'),
expandvars('%PROGRAMFILES%\\Apprise\\apprise.yml'),
expandvars('%PROGRAMFILES%\\Apprise\\apprise.yaml'),

# C:\Program Files\Common Files
expandvars('%COMMONPROGRAMFILES%\\Apprise\\apprise'),
expandvars('%COMMONPROGRAMFILES%\\Apprise\\apprise.conf'),
expandvars('%COMMONPROGRAMFILES%\\Apprise\\apprise.yml'),
expandvars('%COMMONPROGRAMFILES%\\Apprise\\apprise.yaml'),
)
Expand Down
21 changes: 9 additions & 12 deletions packaging/man/apprise.md
Original file line number Diff line number Diff line change
Expand Up @@ -188,27 +188,24 @@ command line and all of them will be loaded. You can also point your configurat
a cloud location (by referencing `http://` or `https://`. By default **apprise** looks
in the following local locations for configuration files and loads them:

~/.apprise
~/.apprise.yml
~/.apprise.conf
~/.apprise.yaml
~/.config/apprise
~/.config/apprise.yml
~/.config/apprise.conf
~/.config/apprise.yaml

~/.apprise/apprise
~/.apprise/apprise.yml
~/.apprise/apprise.conf
~/.apprise/apprise.yaml
~/.config/apprise/apprise
~/.config/apprise/apprise.yml
~/.config/apprise/apprise.conf
~/.config/apprise/apprise.yaml

/etc/apprise
/etc/apprise.yml
/etc/apprise.conf
/etc/apprise.yaml
/etc/apprise/apprise
/etc/apprise/apprise.yml
/etc/apprise/apprise.conf
/etc/apprise/apprise.yaml

The **configuration files** specified above can also be identified with a `.yml`
extension or even just entirely removing the `.conf` extension altogether.

If a default configuration file is referenced in any way by the **apprise**
tool, you no longer need to provide it a Service URL. Usage of the **apprise**
tool simplifies to:
Expand Down

0 comments on commit de1cb52

Please sign in to comment.