pub struct ParsedCommand {
pub command_name: String,
pub arguments: HashMap<String, String>,
}Expand description
Parsed REPL command
Contains the resolved command name and parsed arguments.
This structure is the output of ReplParser::parse_line.
§Fields
command_name: The canonical command name (aliases are resolved)arguments: HashMap of argument/option names to their string values
§Example
use dynamic_cli::parser::repl_parser::ParsedCommand;
use std::collections::HashMap;
let mut args = HashMap::new();
args.insert("input".to_string(), "file.txt".to_string());
let parsed = ParsedCommand {
command_name: "process".to_string(),
arguments: args,
};
assert_eq!(parsed.command_name, "process");
assert_eq!(parsed.arguments.get("input"), Some(&"file.txt".to_string()));Fields§
§command_name: StringThe canonical command name (after alias resolution)
arguments: HashMap<String, String>Parsed arguments and options
Trait Implementations§
Source§impl Clone for ParsedCommand
impl Clone for ParsedCommand
Source§fn clone(&self) -> ParsedCommand
fn clone(&self) -> ParsedCommand
Returns a duplicate of the value. Read more
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
Performs copy-assignment from
source. Read moreSource§impl Debug for ParsedCommand
impl Debug for ParsedCommand
Source§impl PartialEq for ParsedCommand
impl PartialEq for ParsedCommand
impl StructuralPartialEq for ParsedCommand
Auto Trait Implementations§
impl Freeze for ParsedCommand
impl RefUnwindSafe for ParsedCommand
impl Send for ParsedCommand
impl Sync for ParsedCommand
impl Unpin for ParsedCommand
impl UnwindSafe for ParsedCommand
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more