Support for waf command-line options
Provides default command-line options, as well as custom ones, used by the options wscript function.
Constant representing the default waf commands displayed in:
$ waf --help
A dictionary representing the command-line options:
$ waf --foo=bar
List of commands to execute extracted from the command-line. This list is consumed during the execution, see waflib.Scripting.run_commands().
Bases: optparse.OptionParser
Command-line options parser.
Bases: waflib.Context.Context
Collect custom options from wscript files and parses the command line. Set the global waflib.Options.commands and waflib.Options.options values.
Instance of waflib.Options.opt_parser
Find the amount of cpu cores to set the default amount of tasks executed in parallel. At runtime the options can be obtained from waflib.Options.options
from waflib.Options import options
njobs = options.jobs
Returns: | the amount of cpu cores |
---|---|
Return type: | int |
Wrapper for optparse.add_option:
def options(ctx):
ctx.add_option('-u', '--use', dest='use', default=False, action='store_true',
help='a boolean option')
Wrapper for optparse.add_option_group:
def options(ctx):
ctx.add_option_group('some options')
gr.add_option('-u', '--use', dest='use', default=False, action='store_true')
Wrapper for optparse.get_option_group:
def options(ctx):
gr = ctx.get_option_group('configure options')
gr.add_option('-o', '--out', action='store', default='',
help='build dir for the project', dest='out')
Parse arguments from a list (not bound to the command-line).
Parameters: | _args (list of strings) – arguments |
---|