Skip to content

Commit

Permalink
Merge 9b061f6 into 1f6721c
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-akram committed Mar 20, 2019
2 parents 1f6721c + 9b061f6 commit 8d176d5
Show file tree
Hide file tree
Showing 3 changed files with 42 additions and 0 deletions.
34 changes: 34 additions & 0 deletions bla.patch
@@ -0,0 +1,34 @@
diff --git a/ntfy/cli.py b/ntfy/cli.py
index 7dad0b2..d1b2b36 100644
--- a/ntfy/cli.py
+++ b/ntfy/cli.py
@@ -26,6 +26,11 @@ try:
except ImportError:
psutil = None

+try:
+ import argcomplete
+except ImportError:
+ argcomplete = None
+
try:
from .terminal import is_focused
except ImportError:
@@ -294,6 +299,8 @@ shell_integration_parser.set_defaults(func=auto_done)


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:
diff --git a/setup.py b/setup.py
index 13172e3..e825bfe 100644
--- a/setup.py
+++ b/setup.py
@@ -1,3 +1,4 @@
+# PYTHON_ARGCOMPLETE_OK
from sys import version_info

from setuptools import find_packages, setup
7 changes: 7 additions & 0 deletions ntfy/cli.py
Expand Up @@ -26,6 +26,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 +299,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
@@ -1,3 +1,4 @@
# PYTHON_ARGCOMPLETE_OK
from sys import version_info

from setuptools import find_packages, setup
Expand Down

0 comments on commit 8d176d5

Please sign in to comment.