Skip to content

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

Closed
hedger wants to merge 1 commit into
SCons:masterfrom
hedger:hedger/help-arg-fix
Closed

hedger wants to merge 1 commit into
SCons:masterfrom
hedger:hedger/help-arg-fix

Conversation

@hedger

@hedger hedger commented Sep 29, 2024

Copy link
Copy Markdown

Contributor Checklist:

  • I have created a new test or updated the unit tests to cover the new/changed functionality.
  • I have updated CHANGES.txt (and read the README.rst)
  • I have updated the appropriate documentation

@bdbaddog

bdbaddog commented Sep 29, 2024 •

Copy link
Copy Markdown
Contributor

Not sure why you believe this change is needed?
local_only, means only the local addoptions args are in the help.. what's the concern here?

@hedger

hedger commented Sep 30, 2024 •

Copy link
Copy Markdown
Author

@bdbaddog the concern is that documentation is inconsistent with actual behavior.

Currently, the docs mention the following prototype for the Help() function:

env.Help(text, append=False, local_only=False)

While actual implementation in

def HelpFunction(text, append: bool = False, keep_local: bool = False) -> None:
uses the keep_local kwarg name.

I made the documentation consistent with the actual implementation - in order to not break any third-party code that relies on existing behavior. I also renamed the kwarg inside the implementation to avoid confusion.

@mwichmann mwichmann added the args_and_options options processing, arguments, get/setoption and their relationshiop label Oct 27, 2024
@bdbaddog

Copy link
Copy Markdown
Contributor

Seems like it would be simpler to just make everything local_only and not keep_local

also calling Help() in your SConscript calls SCons.SConscript.Help(), and not PrintHelp() (not directly).
Help() calls HelpFunction() which calls PrintHelp()

So the public interface is SCons.SConscript.Help(), and that's what's misdocumented.
(and mis doc-string'ed too I think)

Thoughts @mwichmann ?

Comment thread CHANGES.txt
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
Copy Markdown
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)

@bdbaddog

Copy link
Copy Markdown
Contributor

Replacing this with #4670

@bdbaddog bdbaddog closed this Dec 22, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

args_and_options options processing, arguments, get/setoption and their relationshiop

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants