Skip to content

Commit

Permalink
Use brackets for the default value of option arguments
Browse files Browse the repository at this point in the history
The goal is to standardize the format of the help text printed
by commands. It is not easy to choose between brackets `[]` and
parentheses `()`. I went for the docopt style, which is the
closest to a standard I could find:
	http://docopt.org/

	[...] and whether that argument has a default value ([default: 10]).

This change has already been applied to distutils:
	pypa/distutils#262
  • Loading branch information
DimitriPapadopoulos committed Jun 28, 2024
1 parent 9fa33a1 commit d02b6b1
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 8 deletions.
12 changes: 6 additions & 6 deletions setuptools/command/bdist_wheel.py
Original file line number Diff line number Diff line change
Expand Up @@ -176,7 +176,7 @@ class bdist_wheel(Command):
"plat-name=",
"p",
"platform name to embed in generated filenames "
f"(default: {get_platform(None)})",
f"[default: {get_platform(None)}]",
),
(
"keep-temp",
Expand All @@ -189,7 +189,7 @@ class bdist_wheel(Command):
(
"relative",
None,
"build the archive using relative paths (default: false)",
"build the archive using relative paths [default: false]",
),
(
"owner=",
Expand All @@ -201,18 +201,18 @@ class bdist_wheel(Command):
"g",
"Group name used when creating a tar file [default: current group]",
),
("universal", None, "make a universal wheel (default: false)"),
("universal", None, "make a universal wheel [default: false]"),
(
"compression=",
None,
"zipfile compression (one of: {}) (default: 'deflated')".format(
"zipfile compression (one of: {}) [default: 'deflated']".format(
", ".join(supported_compressions)
),
),
(
"python-tag=",
None,
f"Python implementation compatibility tag (default: '{python_tag()}')",
f"Python implementation compatibility tag [default: '{python_tag()}']",
),
(
"build-number=",
Expand All @@ -224,7 +224,7 @@ class bdist_wheel(Command):
(
"py-limited-api=",
None,
"Python tag (cp32|cp33|cpNN) for abi3 wheel tag (default: false)",
"Python tag (cp32|cp33|cpNN) for abi3 wheel tag [default: false]",
),
]

Expand Down
2 changes: 1 addition & 1 deletion setuptools/command/dist_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ class dist_info(Command):
'output-dir=',
'o',
"directory inside of which the .dist-info will be"
"created (default: top of the source tree)",
"created [default: top of the source tree]",
),
('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"),
('tag-build=', 'b', "Specify explicit tag to add to version number"),
Expand Down
2 changes: 1 addition & 1 deletion setuptools/command/egg_info.py
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ class egg_info(InfoCommon, Command):
'egg-base=',
'e',
"directory containing .egg-info directories"
" (default: top of the source tree)",
" [default: top of the source tree]",
),
('tag-date', 'd', "Add date stamp (e.g. 20050528) to version number"),
('tag-build=', 'b', "Specify explicit tag to add to version number"),
Expand Down

0 comments on commit d02b6b1

Please sign in to comment.