Skip to content

Commit dc7bfe4

Browse files
DimitriPapadopoulosjaraco
authored andcommitted
Use brackets for the default value of option arguments
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]).
1 parent 62135e6 commit dc7bfe4

File tree

7 files changed

+11
-11
lines changed

7 files changed

+11
-11
lines changed

distutils/command/bdist.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -41,7 +41,7 @@ class bdist(Command):
4141
'plat-name=',
4242
'p',
4343
"platform name to embed in generated filenames "
44-
f"(default: {get_platform()})",
44+
f"[default: {get_platform()}]",
4545
),
4646
('formats=', None, "formats for distribution (comma-separated list)"),
4747
(

distutils/command/bdist_dumb.py

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -23,7 +23,7 @@ class bdist_dumb(Command):
2323
'plat-name=',
2424
'p',
2525
"platform name to embed in generated filenames "
26-
f"(default: {get_platform()})",
26+
f"[default: {get_platform()}]",
2727
),
2828
(
2929
'format=',
@@ -40,7 +40,7 @@ class bdist_dumb(Command):
4040
(
4141
'relative',
4242
None,
43-
"build the archive using relative paths (default: false)",
43+
"build the archive using relative paths [default: false]",
4444
),
4545
(
4646
'owner=',

distutils/command/bdist_rpm.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -40,7 +40,7 @@ class bdist_rpm(Command):
4040
'python=',
4141
None,
4242
"path to Python interpreter to hard-code in the .spec file "
43-
"(default: \"python\")",
43+
"[default: \"python\"]",
4444
),
4545
(
4646
'fix-python',

distutils/command/build.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -34,7 +34,7 @@ class build(Command):
3434
(
3535
'plat-name=',
3636
'p',
37-
f"platform name to build for, if supported (default: {get_platform()})",
37+
f"platform name to build for, if supported [default: {get_platform()}]",
3838
),
3939
('compiler=', 'c', "specify the compiler type"),
4040
('parallel=', 'j', "number of parallel build jobs"),

distutils/command/build_ext.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -65,7 +65,7 @@ class build_ext(Command):
6565
'plat-name=',
6666
'p',
6767
"platform name to cross-compile for, if supported "
68-
f"(default: {get_platform()})",
68+
f"[default: {get_platform()}]",
6969
),
7070
(
7171
'inplace',

distutils/command/clean.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -14,17 +14,17 @@
1414
class clean(Command):
1515
description = "clean up temporary files from 'build' command"
1616
user_options = [
17-
('build-base=', 'b', "base build directory (default: 'build.build-base')"),
17+
('build-base=', 'b', "base build directory [default: 'build.build-base']"),
1818
(
1919
'build-lib=',
2020
None,
21-
"build directory for all modules (default: 'build.build-lib')",
21+
"build directory for all modules [default: 'build.build-lib']",
2222
),
23-
('build-temp=', 't', "temporary build directory (default: 'build.build-temp')"),
23+
('build-temp=', 't', "temporary build directory [default: 'build.build-temp']"),
2424
(
2525
'build-scripts=',
2626
None,
27-
"build directory for scripts (default: 'build.build-scripts')",
27+
"build directory for scripts [default: 'build.build-scripts']",
2828
),
2929
('bdist-base=', None, "temporary directory for built distributions"),
3030
('all', 'a', "remove all build output, not just temporary by-products"),

distutils/command/install_data.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ class install_data(Command):
1919
'install-dir=',
2020
'd',
2121
"base directory for installing data files "
22-
"(default: installation base dir)",
22+
"[default: installation base dir]",
2323
),
2424
('root=', None, "install everything relative to this alternate root directory"),
2525
('force', 'f', "force installation (overwrite existing files)"),

0 commit comments

Comments
 (0)