summarylogtreecommitdiffstats
path: root/poetry-completions-generator
blob: 3863380b19397c6d08067ade36a6748260de6a8e (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
#!/usr/bin/python3

# This is a dummy script that fakes its own sys.argv[0] to make the completions
# subcommand do the correct thing when run from the build directory. cleo's
# completion generator uses this to generate completions for sys.argv[0] as well
# as (???) os.path.join(os.getcwd(), sys.argv[0]) for mysterious reasons.
#
# We don't want to complete 'poetry/__main__.py'....

import sys
from poetry.console.application import main

sys.argv = ['poetry', 'completions', sys.argv.pop()]

main()