Skip to content

Commit

Permalink
Add shell completion
Browse files Browse the repository at this point in the history
  • Loading branch information
mohd-akram committed Mar 20, 2019
1 parent 1f6721c commit 93b4f0e
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions ntfy/cli.py
Original file line number Diff line number Diff line change
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
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
# PYTHON_ARGCOMPLETE_OK
from sys import version_info

from setuptools import find_packages, setup
Expand Down

0 comments on commit 93b4f0e

Please sign in to comment.