Module cli

Source
Expand description

CLI argument parsing with subcommands (zero dependencies).

Supports both new-style subcommands and legacy flat-flag mode:

spectroxide solve single-burst --z-h 2e5 --delta-rho 1e-5
spectroxide sweep --z-injections 1e3,1e4,1e5 --format csv
spectroxide greens --z-h 2e5 --delta-rho 1e-5
spectroxide info --cosmology planck2018
spectroxide help

If the first argument is not a known subcommand, falls back to legacy flat-flag parsing with a deprecation warning.

Structs§

CosmoOpts
Cosmology parameters.
GreensOpts
Options for spectroxide greens [flags].
InfoOpts
Options for spectroxide info.
OutputOpts
Output formatting options.
PhotonSweepBatchOpts
Options for spectroxide photon-sweep-batch [flags].
PhotonSweepOpts
Options for spectroxide photon-sweep [flags].
SolveOpts
Options for spectroxide solve <injection-type> [flags].
SolverOpts
Solver tuning parameters.
SweepOpts
Options for spectroxide sweep [flags].

Enums§

Command
Top-level command parsed from CLI args.

Functions§

build_cosmology
Build a Cosmology from CosmoOpts.
build_injection_scenario
Build an InjectionScenario from CLI arguments.
execute_greens
Execute a Green’s function calculation. Returns result without doing I/O.
execute_photon_sweep
Execute a photon injection sweep over multiple injection redshifts at a fixed x_inj. Returns result without doing I/O.
execute_photon_sweep_batch
Execute a batch photon injection sweep over multiple x_inj values.
execute_solve
Execute a single PDE solve. Returns result without doing I/O.
execute_sweep
Execute a sweep over multiple injection redshifts. Returns result without doing I/O.
parse_command
Parse CLI arguments into a Command.
parse_flat_args
Parse flat –key value args into a HashMap (shared by all subcommands and legacy mode).
print_help
Print help text to stderr.
print_info
Print cosmology info.