Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fixed inconsistent usage of keep_local and local_only kwarg in Help() function, its implementation and docs #4606

Closed
wants to merge 1 commit into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 2 additions & 0 deletions CHANGES.txt
Original file line number Diff line number Diff line change
Expand Up @@ -49,6 +49,8 @@ RELEASE VERSION/DATE TO BE FILLED IN LATER
cl.exe-compatible command line switches.
- Some manpage cleanup for the gettext and pdf/ps builders.
- Some clarifications in the User Guide "Environments" chapter.
- Fixed wrong naming in the documentation of "keep_local" parameter for
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

This should be changed to be attributed to you and not to mwichmann.
Please add a section with your name here ( it should be alphabetical by last name)

the Help() method.

From Alex James:
- On Darwin, PermissionErrors are now handled while trying to access
Expand Down
4 changes: 2 additions & 2 deletions SCons/Script/Main.py
Original file line number Diff line number Diff line change
Expand Up @@ -601,8 +601,8 @@ def ValidateOptions(throw_exception: bool = False) -> None:
OptionsParser.preserve_unknown_options = False
OptionsParser.parse_args(OptionsParser.largs, OptionsParser.values)

def PrintHelp(file=None, local_only: bool = False) -> None:
if local_only:
def PrintHelp(file=None, keep_local: bool = False) -> None:
if keep_local:
OptionsParser.print_local_option_help(file=file)
else:
OptionsParser.print_help(file=file)
Expand Down
8 changes: 4 additions & 4 deletions SCons/Script/SConscript.xml
Original file line number Diff line number Diff line change
Expand Up @@ -272,7 +272,7 @@ file is found.

<scons_function name="Help">
<arguments>
(text, append=False, local_only=False)
(text, append=False, keep_local=False)
</arguments>
<summary>
<para>
Expand All @@ -292,7 +292,7 @@ This is the help printed if &f-Help; has never been called.
If <parameter>append</parameter> is <constant>True</constant>,
<parameter>text</parameter> is appended to
the existing help text.
If <parameter>local_only</parameter> is also <constant>True</constant>
If <parameter>keep_local</parameter> is also <constant>True</constant>
(the default is <constant>False</constant>),
the project-local help from &f-AddOption; calls is preserved
in the help message but the &scons; command help is not.
Expand All @@ -301,11 +301,11 @@ in the help message but the &scons; command help is not.
Subsequent calls to
&f-Help; ignore the keyword arguments
<parameter>append</parameter> and
<parameter>local_only</parameter>
<parameter>keep_local</parameter>
and always append to the existing help text.
</para>
<para>
<emphasis>Changed in 4.6.0</emphasis>: added <parameter>local_only</parameter>.
<emphasis>Changed in 4.6.0</emphasis>: added <parameter>keep_local</parameter>.
</para>

</summary>
Expand Down
2 changes: 1 addition & 1 deletion SCons/Script/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -263,7 +263,7 @@ def HelpFunction(text, append: bool = False, keep_local: bool = False) -> None:
if help_text is None:
if append:
with StringIO() as s:
PrintHelp(s, local_only=keep_local)
PrintHelp(s, keep_local=keep_local)
help_text = s.getvalue()
else:
help_text = ""
Expand Down
Loading