fab.tools.flags module#
This file contains a simple Flag class to manage tool flags. It will need to be combined with build_config.FlagsConfig in a follow up PR.
- class fab.tools.flags.Flags(list_of_flags=None)#
Bases:
list
This class represents a list of parameters for a tool. It is a list with some additional functionality.
TODO #22: This class and build_config.FlagsConfig should be combined.
- Parameters:
list_of_flags (
Optional
[List
[str
]]) – List of parameters to initialise this object with. (default:None
)
- remove_flag(remove_flag, has_parameter=False)#
Removes all occurrences of remove_flag in flags`. If has_parameter is defined, the next entry in flags will also be removed, and if this object contains this flag+parameter without space (e.g. -J/tmp), it will be correctly removed. Note that only the flag itself must be specified, you cannot remove a flag only if a specific parameter is given (i.e. remove_flag=”-J/tmp” will not work if this object contains […,”-J”, “/tmp”]).