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's not easy to choose between brackets `[]` and
parentheses `()`. I went for the docopt documentation, which is
the closest to a standard I could find:

	http://docopt.org/

	[...] and whether that argument has a default value ([default: 10]).
  • Loading branch information
DimitriPapadopoulos committed Jun 27, 2024
1 parent 4fd2d56 commit 2a17405
Show file tree
Hide file tree
Showing 7 changed files with 11 additions and 11 deletions.
2 changes: 1 addition & 1 deletion distutils/command/bdist.py
Original file line number Diff line number Diff line change
Expand Up @@ -41,7 +41,7 @@ class bdist(Command):
'plat-name=',
'p',
"platform name to embed in generated filenames "
f"(default: {get_platform()})",
f"[default: {get_platform()}]",
),
('formats=', None, "formats for distribution (comma-separated list)"),
(
Expand Down
4 changes: 2 additions & 2 deletions distutils/command/bdist_dumb.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@ class bdist_dumb(Command):
'plat-name=',
'p',
"platform name to embed in generated filenames "
f"(default: {get_platform()})",
f"[default: {get_platform()}]",
),
(
'format=',
Expand All @@ -40,7 +40,7 @@ class bdist_dumb(Command):
(
'relative',
None,
"build the archive using relative paths (default: false)",
"build the archive using relative paths [default: false]",
),
(
'owner=',
Expand Down
2 changes: 1 addition & 1 deletion distutils/command/bdist_rpm.py
Original file line number Diff line number Diff line change
Expand Up @@ -40,7 +40,7 @@ class bdist_rpm(Command):
'python=',
None,
"path to Python interpreter to hard-code in the .spec file "
"(default: \"python\")",
"[default: \"python\"]",
),
(
'fix-python',
Expand Down
2 changes: 1 addition & 1 deletion distutils/command/build.py
Original file line number Diff line number Diff line change
Expand Up @@ -34,7 +34,7 @@ class build(Command):
(
'plat-name=',
'p',
f"platform name to build for, if supported (default: {get_platform()})",
f"platform name to build for, if supported [default: {get_platform()}]",
),
('compiler=', 'c', "specify the compiler type"),
('parallel=', 'j', "number of parallel build jobs"),
Expand Down
2 changes: 1 addition & 1 deletion distutils/command/build_ext.py
Original file line number Diff line number Diff line change
Expand Up @@ -65,7 +65,7 @@ class build_ext(Command):
'plat-name=',
'p',
"platform name to cross-compile for, if supported "
f"(default: {get_platform()})",
f"[default: {get_platform()}]",
),
(
'inplace',
Expand Down
8 changes: 4 additions & 4 deletions distutils/command/clean.py
Original file line number Diff line number Diff line change
Expand Up @@ -14,17 +14,17 @@
class clean(Command):
description = "clean up temporary files from 'build' command"
user_options = [
('build-base=', 'b', "base build directory (default: 'build.build-base')"),
('build-base=', 'b', "base build directory [default: 'build.build-base']"),
(
'build-lib=',
None,
"build directory for all modules (default: 'build.build-lib')",
"build directory for all modules [default: 'build.build-lib']",
),
('build-temp=', 't', "temporary build directory (default: 'build.build-temp')"),
('build-temp=', 't', "temporary build directory [default: 'build.build-temp']"),
(
'build-scripts=',
None,
"build directory for scripts (default: 'build.build-scripts')",
"build directory for scripts [default: 'build.build-scripts']",
),
('bdist-base=', None, "temporary directory for built distributions"),
('all', 'a', "remove all build output, not just temporary by-products"),
Expand Down
2 changes: 1 addition & 1 deletion distutils/command/install_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ class install_data(Command):
'install-dir=',
'd',
"base directory for installing data files "
"(default: installation base dir)",
"[default: installation base dir]",
),
('root=', None, "install everything relative to this alternate root directory"),
('force', 'f', "force installation (overwrite existing files)"),
Expand Down

0 comments on commit 2a17405

Please sign in to comment.