Skip to content

Commit 6313d86

Browse files
authored
Improve pip config --help text (#11074)
1 parent 7eb7541 commit 6313d86

File tree

2 files changed

+13
-6
lines changed

2 files changed

+13
-6
lines changed

news/11074.doc.rst

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1 @@
1+
Improved usefulness of ``pip config --help`` output.

src/pip/_internal/commands/configuration.py

Lines changed: 12 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -27,11 +27,17 @@ class ConfigurationCommand(Command):
2727
2828
- list: List the active configuration (or from the file specified)
2929
- edit: Edit the configuration file in an editor
30-
- get: Get the value associated with name
31-
- set: Set the name=value
32-
- unset: Unset the value associated with name
30+
- get: Get the value associated with command.option
31+
- set: Set the command.option=value
32+
- unset: Unset the value associated with command.option
3333
- debug: List the configuration files and values defined under them
3434
35+
Configuration keys should be dot separated command and option name,
36+
with the special prefix "global" affecting any command. For example,
37+
"pip config set global.index-url https://example.org/" would configure
38+
the index url for all commands, but "pip config set download.timeout 10"
39+
would configure a 10 second timeout only for "pip download" commands.
40+
3541
If none of --user, --global and --site are passed, a virtual
3642
environment configuration file is used if one is active and the file
3743
exists. Otherwise, all modifications happen to the user file by
@@ -43,9 +49,9 @@ class ConfigurationCommand(Command):
4349
%prog [<file-option>] list
4450
%prog [<file-option>] [--editor <editor-path>] edit
4551
46-
%prog [<file-option>] get name
47-
%prog [<file-option>] set name value
48-
%prog [<file-option>] unset name
52+
%prog [<file-option>] get command.option
53+
%prog [<file-option>] set command.option value
54+
%prog [<file-option>] unset command.option
4955
%prog [<file-option>] debug
5056
"""
5157

0 commit comments

Comments
 (0)