Skip to content

Commit

Permalink
Fix command dispatching
Browse files Browse the repository at this point in the history
  • Loading branch information
frostming committed Feb 27, 2019
1 parent 32876ec commit 3f053a3
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 8 deletions.
8 changes: 1 addition & 7 deletions pipenv/cli/command.py
Original file line number Diff line number Diff line change
Expand Up @@ -12,8 +12,6 @@
import crayons
import delegator

from click_didyoumean import DYMCommandCollection

from ..__version__ import __version__
from .options import (
CONTEXT_SETTINGS, PipenvGroup, code_option, common_options, deploy_option,
Expand Down Expand Up @@ -400,8 +398,7 @@ def shell(
@pass_state
def run(state, command, args):
"""Spawns a command installed into the virtualenv."""
from ..core import do_run, warn_in_virtualenv
warn_in_virtualenv()
from ..core import do_run
do_run(
command=command, args=args, three=state.three, python=state.python, pypi_mirror=state.pypi_mirror
)
Expand Down Expand Up @@ -634,8 +631,5 @@ def clean(ctx, state, dry_run=False, bare=False, user=False):
system=state.system)


# Only invoke the "did you mean" when an argument wasn't passed (it breaks those).
if "-" not in "".join(sys.argv) and len(sys.argv) > 1:
cli = DYMCommandCollection(sources=[cli])
if __name__ == "__main__":
cli()
3 changes: 2 additions & 1 deletion pipenv/cli/options.py
Original file line number Diff line number Diff line change
Expand Up @@ -8,6 +8,7 @@
from click import (
BadParameter, Group, Option, argument, echo, make_pass_decorator, option
)
from click_didyoumean import DYMMixin

from .. import environments
from ..utils import is_valid_url
Expand All @@ -19,7 +20,7 @@
}


class PipenvGroup(Group):
class PipenvGroup(DYMMixin, Group):
"""Custom Group class provides formatted main help"""

def get_help_option(self, ctx):
Expand Down

0 comments on commit 3f053a3

Please sign in to comment.