spacr.__main__

Command-line entry point for python -m spacr.

The module builds and dispatches spaCR’s command-line subcommands. Every window command opens the PySide6 application; with no subcommand it opens on the Home tab.

Copyright © 2025 olafsson lab

Functions

build_parser(→ argparse.ArgumentParser)

Return the argparse parser exposing the spacr CLI subcommands.

main(→ int)

CLI entry point; dispatch to the requested spacr subcommand.

Module Contents

spacr.__main__.build_parser() → argparse.ArgumentParser[source]

Return the argparse parser exposing the spacr CLI subcommands.

Returns:

Parser accepting a single positional command argument.

spacr.__main__.main(argv: list[str] | None = None) → int[source]

CLI entry point; dispatch to the requested spacr subcommand.

Parameters:

argv – Argument list to parse. When None, sys.argv[1:] is used.

Returns:

0 for the version command; window commands return the Qt launcher’s integer exit status.

Raises:

SystemExit – with code 2 when argparse rejects the arguments or a command accepted by the parser has no dispatcher. parser.error never returns, so there is no exit code to hand back in either case.