Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

"pipenv run --help" does not help, but tries to run #4155

Closed
ttencate opened this issue Mar 17, 2020 · 2 comments
Closed

"pipenv run --help" does not help, but tries to run #4155

ttencate opened this issue Mar 17, 2020 · 2 comments
Labels

Comments

@ttencate
Copy link

Issue description

All pipenv subcommands accept --help, like pipenv install --help, pipenv sync --help, and so on. But this doesn't work for pipenv run.

Expected result

pipenv run --help should print help about using this subcommand (flags, etc.).

Actual result

pipenv run --help gets upset when I ask for help:

$ pipenv run --help
Traceback (most recent call last):
  File "/usr/bin/pipenv", line 11, in <module>
    load_entry_point('pipenv==2018.11.15.dev0', 'console_scripts', 'pipenv')()
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 764, in __call__
    return self.main(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 717, in main
    rv = self.invoke(ctx)
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 1137, in invoke
    return _process_result(sub_ctx.command.invoke(sub_ctx))
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 956, in invoke
    return ctx.invoke(self.callback, **ctx.params)
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/decorators.py", line 64, in new_func
    return ctx.invoke(f, obj, *args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pipenv/vendor/click/core.py", line 555, in invoke
    return callback(*args, **kwargs)
  File "/usr/lib/python3.8/site-packages/pipenv/cli/command.py", line 407, in run
    do_run(
  File "/usr/lib/python3.8/site-packages/pipenv/core.py", line 2328, in do_run
    do_run_posix(script, command=command)
  File "/usr/lib/python3.8/site-packages/pipenv/core.py", line 2296, in do_run_posix
    os.execl(
  File "/usr/lib/python3.8/os.py", line 534, in execl
    execv(file, args)
FileNotFoundError: [Errno 2] No such file or directory

I guess that run terminates the command parsing, and it's trying to run an executable named --help. It would be more helpful if the first non-option argument would terminate argument parsing instead, with the customary special -- option available to forcibly terminate argument parsing.

Steps to replicate

See above.

$ pipenv --version
pipenv, version 2018.11.15.dev0
$ python --version
Python 3.8.1
@amhrasmussen
Copy link

Hi @ttencate
This improvement has already been implemented in the master branch. Unfortunately, until #3369 happens you will have to install from git to get this...

@ttencate
Copy link
Author

Great to hear, thanks! I'm in no hurry to get the fix, just thought it was confusing behaviour for newcomers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

No branches or pull requests

2 participants