From 62068e5ead06b64f896de66e9b2b4ce431b2d59f Mon Sep 17 00:00:00 2001 From: Lukas Date: Sun, 14 Nov 2021 19:42:43 +0100 Subject: [PATCH] Document command line escaping for arguments that start with a dash (#4552) Document a solution for using passwords that start with a dash. This happened to a few people when using automatically generated tokens in a CI environment. Fixes #2889 Co-authored-by: Bjorn Neergaard --- docs/repositories.md | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/docs/repositories.md b/docs/repositories.md index 889b961c4ed..f9dd873b84f 100644 --- a/docs/repositories.md +++ b/docs/repositories.md @@ -101,6 +101,14 @@ export POETRY_HTTP_BASIC_PYPI_PASSWORD=password See [Using environment variables]({{< relref "configuration#using-environment-variables" >}}) for more information on how to configure Poetry with environment variables. +If your password starts with a dash (e.g. randomly generated tokens in a CI environment), it will be parsed as a +command line option instead of a password. +You can prevent this by adding double dashes to prevent any following argument from being parsed as an option. + +```bash +poetry config -- http-basic.pypi myUsername -myPasswordStartingWithDash +``` + #### Custom certificate authority and mutual TLS authentication Poetry supports repositories that are secured by a custom certificate authority as well as those that require certificate-based client authentication. The following will configure the "foo" repository to validate the repository's