mirror of
https://github.com/kennethreitz/pipenv.git
synced 2026-06-05 22:50:18 +00:00
+2
-4
@@ -682,11 +682,9 @@ production environments for reproducible builds.
|
||||
☤ Shell Completion
|
||||
------------------
|
||||
|
||||
Set ``_PIPENV_COMPLETE`` and then source the output of the program.
|
||||
For example, with ``fish``, put this in your
|
||||
``~/.config/fish/completions/pipenv.fish``::
|
||||
For fish:
|
||||
|
||||
eval (env _PIPENV_COMPLETE=source-fish pipenv)
|
||||
eval (pipenv --completion)
|
||||
|
||||
Magic shell completions are now enabled!
|
||||
|
||||
|
||||
+8
-1
@@ -1498,7 +1498,14 @@ def cli(
|
||||
sys.exit()
|
||||
|
||||
if completion:
|
||||
os.environ['_PIPENV_COMPLETE'] = 'source-{0}'.format(os.environ['SHELL'].split(os.sep)[-1])
|
||||
try:
|
||||
os.environ['_PIPENV_COMPLETE'] = 'source-{0}'.format(os.environ['SHELL'].split(os.sep)[-1])
|
||||
except KeyError:
|
||||
click.echo(
|
||||
'Please ensure that the {0} environment variable '
|
||||
'is set.'.format(crayons.white('SHELL', bold=True)), err=True)
|
||||
sys.exit(1)
|
||||
|
||||
c = delegator.run('pipenv')
|
||||
click.echo(c.out)
|
||||
sys.exit(0)
|
||||
|
||||
Reference in New Issue
Block a user