From 56597a6a68e741355b301f91d5913d59cfb34eaa Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?J=C3=B6rg=20Frings-F=C3=BCrst?= Date: Sat, 28 Dec 2019 17:12:41 +0100 Subject: New upstream version 3.1.2 --- doc/user/command-line.xml | 63 +++++++++++++++++++++++++++++++++++++++++------ 1 file changed, 55 insertions(+), 8 deletions(-) (limited to 'doc/user/command-line.xml') diff --git a/doc/user/command-line.xml b/doc/user/command-line.xml index bb1d32b..e14ed07 100644 --- a/doc/user/command-line.xml +++ b/doc/user/command-line.xml @@ -2,7 +2,7 @@ %scons; - + %builders-mod; @@ -89,7 +89,7 @@ all of the command-line variable settings, the ability to apply command-line variable settings to construction environments, - and functions for configuring + and functions for configuring specific types of variables (Boolean values, path names, etc.) with automatic validation of the user's specified values. @@ -599,24 +599,30 @@ foo.in &SCons; also allows you to define your own command-line options with the &AddOption; function. The &AddOption; function takes the same arguments - as the optparse.add_option function - from the standard Python library. + as the add_option method + from the standard Python library module optparse. The &AddOption; function is, in fact, implemented using a subclass - of the optparse.OptionParser. + of optparse.OptionParser. + + + Once you have added a custom command-line option with the &AddOption; function, the value of the option (if any) is immediately available using the standard &GetOption; function. + + &SetOption; is not currently supported for + options added with &AddOption;. @@ -678,6 +684,47 @@ foo.in scons -Q -n --prefix=/tmp/install + + + Option-arguments separated from long options by whitespace, + rather than by an =, cannot be correctly + resolved by scons. + While --input=ARG + is clearly opt followed by arg, for --input ARG + it is not possible to tell without instructions whether + ARG is an argument belonging to the + input option or a positional argument. + scons treats positional arguments as either + command-line build options or command-line targets + which are made available for use in an &SConscript; + (see the immediately following sections for details). + Thus, they must be collected before &SConscript; processing + takes place. Since &AddOption; calls, which provide + the processing instructions to resolve any ambiguity, + happen in an &SConscript;, + scons does not know in time + for options added this way, and unexpected things will happen, + such as option-arguments assigned as targets and/or exceptions + due to missing option-arguments. + + + As a result, this usage style should be avoided when invoking + scons. For single-argument + options, use the --input=ARG form on the + command line. For multiple-argument options + (nargs greater than one), + set nargs to one in + &AddOption; calls and either: combine the option-arguments into one word + with a separator, and parse the result in your own code + (see the built-in --debug option, which + allows specifying multiple arguments as a single comma-separated + word, for an example of such usage); or allow the option to + be specified multiple times by setting + action='append'. Both methods can be + supported at the same time. + + + @@ -1132,12 +1179,12 @@ vars = Variables('custom.py', ARGUMENTS) - + where values in the option file &custom_py; get overwritten by the ones specified on the command line. - +
-- cgit v1.2.3