From 34f07c7f6901a415c7ec0da4754ef5dd4c3e59d1 Mon Sep 17 00:00:00 2001 From: wim glenn Date: Thu, 28 Apr 2022 22:45:48 -0500 Subject: [PATCH] makes https://pip.pypa.io/en/stable/cli/pip_config/ a bit easier to understand --- news/11074.doc.rst | 1 + src/pip/_internal/commands/configuration.py | 18 ++++++++++++------ 2 files changed, 13 insertions(+), 6 deletions(-) create mode 100644 news/11074.doc.rst diff --git a/news/11074.doc.rst b/news/11074.doc.rst new file mode 100644 index 00000000000..8353f0ac7ad --- /dev/null +++ b/news/11074.doc.rst @@ -0,0 +1 @@ +Improved usefulness of ``pip config --help`` output. diff --git a/src/pip/_internal/commands/configuration.py b/src/pip/_internal/commands/configuration.py index 941ee87b5e0..e3837325986 100644 --- a/src/pip/_internal/commands/configuration.py +++ b/src/pip/_internal/commands/configuration.py @@ -27,11 +27,17 @@ class ConfigurationCommand(Command): - list: List the active configuration (or from the file specified) - edit: Edit the configuration file in an editor - - get: Get the value associated with name - - set: Set the name=value - - unset: Unset the value associated with name + - get: Get the value associated with command.option + - set: Set the command.option=value + - unset: Unset the value associated with command.option - debug: List the configuration files and values defined under them + Configuration keys should be dot separated command and option name, + with the special prefix "global" affecting any command. For example, + "pip config set global.index-url https://example.org/" would configure + the index url for all commands, but "pip config set download.timeout 10" + would configure a 10 second timeout only for "pip download" commands. + If none of --user, --global and --site are passed, a virtual environment configuration file is used if one is active and the file exists. Otherwise, all modifications happen to the user file by @@ -43,9 +49,9 @@ class ConfigurationCommand(Command): %prog [] list %prog [] [--editor ] edit - %prog [] get name - %prog [] set name value - %prog [] unset name + %prog [] get command.option + %prog [] set command.option value + %prog [] unset command.option %prog [] debug """