Skip to content

Commit

Permalink
Merge b4a48e2 into ecfeee9
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-akram committed Mar 20, 2019
2 parents ecfeee9 + b4a48e2 commit 6d1c433
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 0 deletions.
1 change: 1 addition & 0 deletions README.rst
Expand Up @@ -82,6 +82,7 @@ Extras
``ntfy`` has a few features that require extra dependencies.
* ``ntfy done -p $PID`` requires installing as ``pip install ntfy[pid]``
* `emoji <https://en.wikipedia.org/wiki/Emoji>`_ support requires installing as ``pip install ntfy[emoji]``
* `autocomplete <https://argcomplete.readthedocs.io>`_ support requires installing as ``pip install ntfy[autocomplete]``
* `XMPP <https://xmpp.org/>`_ support requires installing as ``pip install ntfy[xmpp]``
* `Telegram <https://telegram.org/>`_ support requires installing as ``pip install ntfy[telegram]``
* `Instapush <https://instapush.im/>`_ support requires installing as ``pip install ntfy[instapush]``
Expand Down
8 changes: 8 additions & 0 deletions ntfy/cli.py
@@ -1,3 +1,4 @@
# PYTHON_ARGCOMPLETE_OK
import argparse
import logging
import logging.config
Expand Down Expand Up @@ -26,6 +27,11 @@
except ImportError:
psutil = None

try:
import argcomplete
except ImportError:
argcomplete = None

try:
from .terminal import is_focused
except ImportError:
Expand Down Expand Up @@ -294,6 +300,8 @@ def default_sender(args):


def main(cli_args=None):
if argcomplete is not None:
argcomplete.autocomplete(parser)
if cli_args is not None:
args = parser.parse_args(cli_args)
else:
Expand Down
1 change: 1 addition & 0 deletions setup.py
Expand Up @@ -14,6 +14,7 @@
'instapush': ['instapush'],
'emoji': ['emoji'],
'pid':['psutil'],
'autocomplete':['argcomplete'],
'slack':['slacker'],
'rocketchat':['rocketchat-API'],
'matrix':['matrix_client'],
Expand Down

0 comments on commit 6d1c433

Please sign in to comment.