Support for waf command-line options
Provides default and command-line options, as well the command that reads the options wscript function.
A global dictionary representing user-provided command-line options:
$ waf --foo=bar
List of commands to execute extracted from the command-line. This list is consumed during the execution by waflib.Scripting.run_commands().
List of environment variable declarations placed after the Waf executable name. These are detected by searching for “=” in the remaining arguments. You probably do not want to use this.
Name of the lock file that marks a project as configured
Bases: optparse.OptionParser
Command-line options parser.
Bases: waflib.Context.Context
Collects custom options from wscript files and parses the command line. Sets the global waflib.Options.commands and waflib.Options.options values.
Instance of waflib.Options.opt_parser
Finds the optimal amount of cpu cores to use for parallel jobs. 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 |
Wraps optparse.add_option:
def options(ctx):
ctx.add_option('-u', '--use', dest='use', default=False,
action='store_true', help='a boolean option')
Return type: | optparse option object |
---|
Wraps optparse.add_option_group:
def options(ctx):
gr = ctx.add_option_group('some options')
gr.add_option('-u', '--use', dest='use', default=False, action='store_true')
Return type: | optparse option group object |
---|
Wraps 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')
Return type: | optparse option group object |
---|
Parses arguments from a list which is not necessarily the command-line. Initializes the module variables options, commands and envvars If help is requested, prints it and exit the application
Parameters: | _args (list of strings) – arguments |
---|