You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
These observations come out of issue #3007 :
If a tool module chooses to add command-line options which only it will consume, the behavior isn't always what you might expect. As of this writing, one internal tool module, install.py, does this. It uses AddOption in its generate function, which means the option is only added to SCons if the tool's generate is actually called.
asking for --help will not go through a code path that calls the tool's generate, so the option's help text never shows up.
there are various circumstances under which the option can be missing, leading to confusing errors when an option you may have documented for your users fails. For example, with the install tool, calling scons --install-sandbox=zzz when the SConstruct doesn't have an install in it errors out:
SCons Error: no such option: --install-sandbox
I don't have a general solution for the problem at the moment. Some questions to ponder:
Is AddOption the right way to add an option in a tool, or should some more internal method be used?
Should tools in fact ever do this? Is it different for included-in-scons tools vs. user-written tools?
is there guidance we can give to tool writers to help get it right?
The text was updated successfully, but these errors were encountered:
bdbaddog
changed the title
tool-specific cmdline options aren't always obvious
Add way for tools to add command line arguments which would show up in -h when appropriate
Sep 29, 2019
bdbaddog
changed the title
Add way for tools to add command line arguments which would show up in -h when appropriate
Add way for Tool()'s to add command line arguments which would show up in -h when appropriate
Sep 29, 2019
mwichmann
changed the title
Add way for Tool()'s to add command line arguments which would show up in -h when appropriate
Improve the way Tool modules add cmdline options for themselves
Feb 17, 2020
These observations come out of issue #3007 :
If a tool module chooses to add command-line options which only it will consume, the behavior isn't always what you might expect. As of this writing, one internal tool module,
install.py
, does this. It usesAddOption
in itsgenerate
function, which means the option is only added to SCons if the tool'sgenerate
is actually called.--help
will not go through a code path that calls the tool'sgenerate
, so the option's help text never shows up.scons --install-sandbox=zzz
when theSConstruct
doesn't have an install in it errors out:I don't have a general solution for the problem at the moment. Some questions to ponder:
AddOption
the right way to add an option in a tool, or should some more internal method be used?The text was updated successfully, but these errors were encountered: