# ``twisted`.`application`.`twist`.`_options`.`TwistOptions``

class documentation

`class TwistOptions(Options): (source)`

View In Hierarchy

Command line options for `twist`.

Method | `__init__` | Undocumented
Method | `getSynopsis` | Returns a string containing a description of these options and how to pass them to the executed file.
Method | `installReactor` | Install the reactor.
Method | `opt_log_file` | Log to file. ("-" for stdout, "+" for stderr; default: "-")
Method | `opt_log_format` | Log file format. (options: "text", "json"; default: "text" if the log file is a tty, otherwise "json")
Method | `opt_log_level` | Set default log level. (options: {options}; default: "{default}")
Method | `opt_reactor` | The name of the reactor to use. (options: {options})
Method | `opt_version` | Print version and exit.
Method | `parseOptions` | The guts of the command-line parser.
Method | `postOptions` | I am called after the options are parsed.
Method | `selectDefaultLogObserver` | Set `fileLogObserverFactory` to the default appropriate for the chosen `logFile`.
Class Variable | `defaultReactorName` | Undocumented
Instance Variable | `longdesc` | Undocumented
Property | `plugins` | Undocumented
Property | `subCommands` | Undocumented

Inherited from `Options`:

Method | `__str__` | Undocumented
Method | `getUsage` | Undocumented
Method | `opt_help` | Display this help and exit.
Method | `parseArgs` | I am called with any leftover arguments which were not options.
Class Variable | `completionData` | Undocumented
Class Variable | `defaultSubCommand` | Undocumented
Class Variable | `parent` | Undocumented
Instance Variable | `defaults` | Undocumented
Instance Variable | `docs` | Undocumented
Instance Variable | `longOpt` | Undocumented
Instance Variable | `opts` | Undocumented
Instance Variable | `shortOpt` | Undocumented
Instance Variable | `subCommand` | Undocumented
Instance Variable | `subOptions` | Undocumented
Instance Variable | `synonyms` | Undocumented
Method | `_gather_flags` | Gather up boolean (flag) options.
Method | `_gather_handlers` | Gather up options with their own handler methods.
Method | `_gather_parameters` | Gather options which take a value.
Method | `_generic_flag` | Undocumented
Instance Variable | `_dispatch` | Undocumented

def __init__(self): (source)
overrides `twisted.python.usage.Options.__init__`

Undocumented

def getSynopsis(self): (source)
overrides `twisted.python.usage.Options.getSynopsis`
Returns a string containing a description of these options and how to pass them to the executed file.

Returns
`str` | Undocumented

def installReactor(self, name): (source)
Install the reactor.

Parameters
name:`str` | Undocumented
Returns
`IReactorCore` | Undocumented

def opt_log_file(self, fileName): (source)
Log to file. ("-" for stdout, "+" for stderr; default: "-")

Parameters
fileName:`str` | Undocumented

def opt_log_format(self, format): (source)
Log file format. (options: "text", "json"; default: "text" if the log file is a tty, otherwise "json")

Parameters
format:`str` | Undocumented

def opt_log_level(self, levelName): (source)
Set default log level. (options: {options}; default: "{default}")

Parameters
levelName:`str` | Undocumented

def opt_reactor(self, name): (source)
The name of the reactor to use. (options: {options})

Parameters
name:`str` | Undocumented

def opt_version(self): (source)
overrides `twisted.python.usage.Options.opt_version`
Print version and exit.

Returns
`typing.NoReturn` | Undocumented

def parseOptions(self, options=None): (source)
overrides `twisted.python.usage.Options.parseOptions`
The guts of the command-line parser.

Parameters
options:`Optional[Sequence[str]]` | Undocumented

def postOptions(self): (source)
overrides `twisted.python.usage.Options.postOptions`

I am called after the options are parsed.

Override this method in your subclass to do something after the options have been parsed and assigned, like validate that all options are sane.

def selectDefaultLogObserver(self): (source)
Set `fileLogObserverFactory` to the default appropriate for the chosen `logFile`.
defaultReactorName: `str` = (source)

Undocumented

longdesc: `str` = (source)

Undocumented

@property
plugins: `Mapping[str, IServiceMaker]` = (source)

Undocumented

@property
subCommands: `Iterable[Tuple[str, None, Callable[[IServiceMaker], Options], str]]` = (source)

Undocumented