Skip to content
Snippets Groups Projects
Commit 9d393628 authored by Michal Arbet's avatar Michal Arbet
Browse files

New upstream version 0.2.0

parent 1a184198
Branches
Tags upstream/0.2.0
No related merge requests found
Metadata-Version: 1.0
Name: click-repl
Version: 0.1.6
Version: 0.2.0
Summary: REPL plugin for Click
Home-page: https://github.com/untitaker/click-repl
Author: Markus Unterwaditzer
......
......@@ -47,6 +47,16 @@ PyPI: `<https://pypi.python.org/pypi/click-repl>`_
.. _click: http://click.pocoo.org/
How to install
==============
Installation is done with pip:
$ pip install click-repl
Advanced Usage
==============
......
Metadata-Version: 1.0
Name: click-repl
Version: 0.1.6
Version: 0.2.0
Summary: REPL plugin for Click
Home-page: https://github.com/untitaker/click-repl
Author: Markus Unterwaditzer
......
......@@ -3,7 +3,6 @@ from prompt_toolkit.completion import Completer, Completion
from prompt_toolkit.history import InMemoryHistory
from prompt_toolkit.shortcuts import prompt
import click
import click._bashcomplete
import click.parser
import os
import shlex
......@@ -11,6 +10,14 @@ import sys
import six
from .exceptions import InternalCommandException, ExitReplException # noqa
# Handle backwards compatibility between Click 7.0 and 8.0
try:
import click.shell_completion
HAS_C8 = True
except ImportError:
import click._bashcomplete
HAS_C8 = False
# Handle click.exceptions.Exit introduced in Click 7.0
try:
from click.exceptions import Exit as ClickExit
......@@ -26,7 +33,7 @@ else:
text_type = str # noqa
__version__ = "0.1.6"
__version__ = "0.2.0"
_internal_commands = dict()
......@@ -107,8 +114,12 @@ class ClickCompleter(Completer):
# We've not entered anything, either at all or for the current
# command, so give all relevant completions for this context.
incomplete = ""
ctx = click._bashcomplete.resolve_ctx(self.cli, "", args)
# Resolve context based on click version
if HAS_C8:
ctx = click.shell_completion._resolve_context(self.cli, {}, "", args)
else:
ctx = click._bashcomplete.resolve_ctx(self.cli, "", args)
if ctx is None:
return
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment