Skip to content

Commit

Permalink
Small docstring update for vars.Add
Browse files Browse the repository at this point in the history
Signed-off-by: Mats Wichmann <[email protected]>
  • Loading branch information
mwichmann committed Jun 3, 2024
1 parent 91b6bcc commit a7f4ab1
Showing 1 changed file with 12 additions and 6 deletions.
18 changes: 12 additions & 6 deletions SCons/Variables/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -135,7 +135,8 @@ def _do_add(
option.default = default
option.validator = validator
option.converter = converter
option.do_subst = kwargs.get("subst", True)
option.do_subst = kwargs.pop("subst", True)
# TODO should any remaining kwargs be saved in the Variable?

self.options.append(option)

Expand All @@ -158,21 +159,26 @@ def Add(
Arguments:
key: the name of the variable, or a 5-tuple (or list).
If *key* is a tuple, and there are no additional positional
arguments, it is unpacked into the variable name plus the four
listed keyword arguments from below.
arguments, it is unpacked into the variable name plus the
*help*, *default*, *validator* and *converter keyword args.
If *key* is a tuple and there are additional positional arguments,
the first word of the tuple is taken as the variable name,
and the remainder as aliases.
args: optional positional arguments, corresponding to the four
listed keyword arguments.
args: optional positional arguments, corresponding to the
*help*, *default*, *validator* and *converter keyword args.
kwargs: arbitrary keyword arguments used by the variable itself.
Keyword Args:
help: help text for the variable (default: ``""``)
help: help text for the variable (default: empty string)
default: default value for variable (default: ``None``)
validator: function called to validate the value (default: ``None``)
converter: function to be called to convert the variable's
value before putting it in the environment. (default: ``None``)
subst: if true perform substitution on the value before the converter
and validator functions (if any) are called (default: ``True``)
.. versionadded:: 4.8.0
The *subst* keyword argument is now specially recognized.
"""
if SCons.Util.is_Sequence(key):
# If no other positional args (and no fundamental kwargs),
Expand Down

0 comments on commit a7f4ab1

Please sign in to comment.