Skip to content

Commit e22ffa5

Browse files
committed
Fix error message and improve help text
1 parent a8ba0ee commit e22ffa5

File tree

3 files changed

+6
-3
lines changed

3 files changed

+6
-3
lines changed

news/3297dfd6-b078-4452-97a1-7d2c1ab41ca1.trivial.rst

Whitespace-only changes.

src/pip/_internal/commands/list.py

Lines changed: 5 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -103,7 +103,10 @@ def add_options(self) -> None:
103103
dest="list_format",
104104
default="columns",
105105
choices=("columns", "freeze", "json"),
106-
help="Select the output format among: columns (default), freeze, or json",
106+
help=(
107+
"Select the output format among: columns (default), freeze, or json. "
108+
"The 'freeze' format cannot be used together with the --outdated option."
109+
),
107110
)
108111

109112
self.cmd_opts.add_option(
@@ -157,7 +160,7 @@ def run(self, options: Values, args: List[str]) -> int:
157160

158161
if options.outdated and options.list_format == "freeze":
159162
raise CommandError(
160-
"List format 'freeze' can not be used with the --outdated option."
163+
"List format 'freeze' cannot be used together with the --outdated option."
161164
)
162165

163166
cmdoptions.check_list_path_option(options)

tests/functional/test_list.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -588,7 +588,7 @@ def test_outdated_formats(script: PipTestEnvironment, data: TestData) -> None:
588588
expect_error=True,
589589
)
590590
assert (
591-
"List format 'freeze' can not be used with the --outdated option."
591+
"List format 'freeze' cannot be used together with the --outdated option."
592592
in result.stderr
593593
)
594594

0 commit comments

Comments
 (0)