Command Line Interface (xonsh.main)

The main xonsh script.

class xonsh.main.XonshMode[source]

An enumeration.

interactive = 3
script_from_file = 1
script_from_stdin = 2
single_command = 0
xonsh.main.get_setproctitle()[source]

Proxy function for loading process title

xonsh.main.main(argv=None)[source]
xonsh.main.main_context(argv=None)[source]

Generator that runs pre- and post-main() functions. This has two iterations. The first yields the shell. The second returns None but cleans up the shell.

xonsh.main.main_xonsh(args)[source]

Main entry point for xonsh cli.

xonsh.main.path_argument(s)[source]

Return a path only if the path is actually legal

This is very similar to argparse.FileType, except that it doesn’t return an open file handle, but rather simply validates the path.

xonsh.main.postmain(args=None)[source]

Teardown for main xonsh entry point, accepts parsed arguments.

xonsh.main.premain(argv=None)[source]

Setup for main xonsh entry point, returns parsed arguments.

xonsh.main.start_services(shell_kwargs)[source]

Starts up the essential services in the proper order. This returns the envrionment instance as a convenience.