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

scons -h should print new options #2356

Closed
bdbaddog opened this issue Jan 2, 2018 · 3 comments · Fixed by #4388
Closed

scons -h should print new options #2356

bdbaddog opened this issue Jan 2, 2018 · 3 comments · Fixed by #4388
Assignees
Labels
args_and_options options processing, arguments, get/setoption and their relationshiop
Milestone

Comments

@bdbaddog
Copy link
Contributor

bdbaddog commented Jan 2, 2018

This issue was originally created at: 2009-02-24 13:54:13.
This issue was reported by: stevenknight.

stevenknight said at 2009-02-24 13:54:13

If you add options to SCons via AddOption(), SCons will print them in its optparse-style help shown by scons -h.

However, if you also add help text via Help(), SCons no longer prints the optparse-style help. You can still see help on SCons's built-in command line options using scons -H, but since that doesn't parse the SConscript files it doesn't show any of the added options.

The feature request is for SCons to maintain a second optparse instance containing only the options added via AddOption(). If help text has been added via Help(), SCons could print only the optparse help for this second optparse instance, followed by the text added via Help().

The text of the final line of help: 'Use scons -H for help about command-line options.' should also be changed to something like 'Use scons -H for help about scons built-in command-line options.' since it doesn't print help about ALL command line options, only those built into SCons.

gregnoel said at 2009-03-05 15:16:13

Bug party triage.

stevenknight said at 2009-11-10 18:00:20

stevenknight => issues@scons

@mwichmann
Copy link
Collaborator

Adding comments to let github linking work: see also #2611, #2258, #2831. Since two of those are closed (one as a dup, one resolved), is this still an issue?

@mwichmann
Copy link
Collaborator

The current behavior is documented, but I don't like it either. All options added via AddOption already go into a separate option group (local_option_group, which is a SConsOptionGroup), so it should be possible to fish them out separately... it's not trivial because of the way help is processed, but should be doable.

@mwichmann mwichmann self-assigned this May 15, 2020
@mwichmann mwichmann added args_and_options options processing, arguments, get/setoption and their relationshiop and removed P2 Version: 1.2.0.d20090223 labels Mar 20, 2021
@mwichmann mwichmann modified the milestones: 2.x, anytime Mar 27, 2021
mwichmann added a commit to mwichmann/scons that referenced this issue Jun 27, 2023
As noted in issue SCons#2356 (which this change does not complete/close),
the final line of help if the help message has been modified is
'Use scons -H for help about command-line options.'. This fails to
mention that -H prints only those options that are defined in SCons
itself, not options added via AddOption. Adjust the message to better
indicate this.

Signed-off-by: Mats Wichmann <mats@linux.com>
@mwichmann
Copy link
Collaborator

I have an implementation that fishes the help out of the local option group. The question now is what the right way to present this is.

Help(txt)  # all existing help text is tossed
Help(txt, append=True)  # full help is saved, SCons + AddOption
Help(txt, local_only=True)  # SCons help is tossed, but AddOption text is saved

It feels to me that the primary behavior should be that of the tentatively-named local_only (that is, that's what should happen when the longer-standing append=True is given), and the less-common option should be to also save the SCons help.

Also the sense of the flags could change: in the experimental version you need append False and local_only True to save the local help, but that could easily be both-True.

mwichmann added a commit to mwichmann/scons that referenced this issue Aug 1, 2023
An additional keyword argument, "local_only", is now recorgnized
by Help(). If true, and "append" is True, then only project-defined
help messages are saved into the help text. That is, save help added
by calls to AddOption, but not SCons' own help, which is added
a different way.

Fixes SCons#2356
Fixes SCons#3686

Signed-off-by: Mats Wichmann <mats@linux.com>
mwichmann added a commit to mwichmann/scons that referenced this issue Aug 1, 2023
An additional keyword argument, "local_only", is now recorgnized
by Help(). If true, and "append" is True, then only project-defined
help messages are saved into the help text. That is, save help added
by calls to AddOption, but not SCons' own help, which is added
a different way.

Fixes SCons#2356
Fixes SCons#3686

Signed-off-by: Mats Wichmann <mats@linux.com>
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 a pull request may close this issue.

2 participants