scons icon indicating copy to clipboard operation
scons copied to clipboard

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

Open hedger opened this issue 1 year ago • 2 comments

Contributor Checklist:

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

hedger avatar Sep 29 '24 18:09 hedger

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?

bdbaddog avatar Sep 29 '24 20:09 bdbaddog

@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 https://github.com/SCons/scons/blob/4f3e3026bc455b3b47666567f273b2f84f932d32/SCons/Script/init.py#L254 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.

hedger avatar Sep 30 '24 09:09 hedger

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 ?

bdbaddog avatar Nov 11 '24 00:11 bdbaddog

Replacing this with #4670

bdbaddog avatar Dec 22 '24 01:12 bdbaddog