Module arguments

Module arguments 

Source
Expand description

Command-line argument parsing for the interpreter prompt.

This module provides argument parsing for the Tor interpreter command-line interface, handling connection options, execution modes, and display settings.

§Overview

The interpreter accepts various command-line arguments to configure:

  • Control interface connection (TCP port or Unix socket)
  • Tor binary path for auto-starting
  • Single command or script execution
  • Output formatting options

§Supported Arguments

ShortLongDescription
-i--interfaceControl interface [ADDRESS:]PORT
-s--socketUnix domain socket path
--torPath to Tor binary
--runCommand or script file to execute
--no-colorDisable colored output
-h--helpShow help message

§Example

use stem_rs::interpreter::arguments::Arguments;

// Parse command-line arguments
let args = Arguments::parse(&[
    "-i".to_string(),
    "9051".to_string(),
    "--no-color".to_string(),
]).unwrap();

assert_eq!(args.control_port, Some(9051));
assert!(args.disable_color);

§Python Stem Equivalent

This module corresponds to Python Stem’s stem.interpreter.arguments module.

Structs§

Arguments
Parsed command-line arguments for the interpreter.