Skip to content

Commit 7ea8caf

Browse files
committed
Rearrange commit_option()
1 parent dae01fe commit 7ea8caf

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

repo_helper/cli/options.py

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,18 +50,20 @@ def commit_option(default: Optional[bool]) -> Callable:
5050
* :py:obj:`False` -- Don't commit
5151
"""
5252

53+
help_text = "Commit or do not commit any changed files. [default: {default}]"
54+
5355
if default is True:
54-
help_text = "Commit or do not commit any changed files. [default: Commit automatically]"
56+
default_text = "Commit automatically"
5557
elif default is False:
56-
help_text = "Commit or do not commit any changed files. [default: Don't commit]"
58+
default_text = "Don't commit"
5759
else:
58-
help_text = "Commit or do not commit any changed files. [default: Ask first]"
60+
default_text = "Ask first"
5961

6062
return autocomplete_option(
6163
"-y/-n",
6264
"--commit/--no-commit",
6365
default=default,
64-
help=help_text,
66+
help=help_text.format(default=default_text),
6567
)
6668

6769

0 commit comments

Comments
 (0)