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

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

hedger
Copy link

@hedger hedger commented Sep 29, 2024

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
Copy link
Contributor

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

@hedger
Copy link
Author

hedger commented Sep 30, 2024

@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
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 ?

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