diff options
author | Steven Knight <knight@baldmt.com> | 2004-05-23 12:11:42 (GMT) |
---|---|---|
committer | Steven Knight <knight@baldmt.com> | 2004-05-23 12:11:42 (GMT) |
commit | d157a17661410b67ad01cefa8d60b4c265185738 (patch) | |
tree | 9c3de3248b5a9de87ec2e166227213fc768ac202 /doc | |
parent | 6f16c7447f7aa3be24662edf48fbf4466448cd9c (diff) | |
download | SCons-d157a17661410b67ad01cefa8d60b4c265185738.zip SCons-d157a17661410b67ad01cefa8d60b4c265185738.tar.gz SCons-d157a17661410b67ad01cefa8d60b4c265185738.tar.bz2 |
Add support for fetching command-line arguments by position number. (Gary Oberbrunner)
Diffstat (limited to 'doc')
-rw-r--r-- | doc/man/scons.1 | 42 |
1 files changed, 42 insertions, 0 deletions
diff --git a/doc/man/scons.1 b/doc/man/scons.1 index ea0cf81..51c9e4c 100644 --- a/doc/man/scons.1 +++ b/doc/man/scons.1 @@ -314,6 +314,17 @@ else: env = Environment() .EE +The command-line variable arguments are also available +in the ARGLIST list, +indexed by their order on the command line. +This allows you to process them in order rather than by name, +if necessary. +ARGLIST[0] returns a tuple +containing (argname, argvalue). +A Python exception is thrown if you +try to access a list member that +does not exist. + .B scons requires Python version 1.5.2 or later. There should be no other dependencies or requirements to run @@ -3751,6 +3762,37 @@ to affect how you want the build to be performed. '\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" .TP +ARGLIST +A list +.IR keyword = value +arguments specified on the command line. +Each element in the list is a tuple +containing the +.RI ( keyword , value ) +of the argument. +The separate +.I keyword +and +.I value +elements of the tuple +can be accessed by +subscripting for element +.B [0] +and +.B [1] +of the tuple, respectively. + +.ES +print "first keyword, value =", ARGLIST[0][0], ARGLIST[0][1] +print "second keyword, value =", ARGLIST[1][0], ARGLIST[1][1] +third_tuple = ARGLIST[2] +print "third keyword, value =", third_tuple[0], third_tuple[1] +for key, value in ARGLIST: + # process key and value +.EE + +'\""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""""" +.TP ARGUMENTS A dictionary of all the .IR keyword = value |