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
| Short | Long | Description |
|---|---|---|
-i | --interface | Control interface [ADDRESS:]PORT |
-s | --socket | Unix domain socket path |
--tor | Path to Tor binary | |
--run | Command or script file to execute | |
--no-color | Disable colored output | |
-h | --help | Show 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.