refactor(commands): remove args from parse command as it is no longer used anymore

This commit is contained in:
dusk 2025-01-12 05:55:25 +09:00
parent 58b5a26eca
commit a21210f3ce
No known key found for this signature in database
3 changed files with 0 additions and 7 deletions

View file

@ -19,7 +19,6 @@ public abstract record Parameter()
public class Parameters
{
private string _cb { get; init; }
private List<string> _args { get; init; }
private Dictionary<string, string?> _flags { get; init; }
private Dictionary<string, uniffi.commands.Parameter> _params { get; init; }
@ -34,7 +33,6 @@ public class Parameters
{
var command = ((CommandResult.Ok)result).@command;
_cb = command.@commandRef;
_args = command.@args;
_flags = command.@flags;
_params = command.@params;
}

View file

@ -18,7 +18,6 @@ interface Parameter {
};
dictionary ParsedCommand {
string command_ref;
sequence<string> args;
record<string, Parameter> params;
record<string, string?> flags;
};

View file

@ -52,7 +52,6 @@ pub enum Parameter {
#[derive(Debug)]
pub struct ParsedCommand {
pub command_ref: String,
pub args: Vec<String>,
pub params: HashMap<String, Parameter>,
pub flags: HashMap<String, Option<String>>,
}
@ -64,7 +63,6 @@ pub fn parse_command(prefix: String, input: String) -> CommandResult {
// end position of all currently matched tokens
let mut current_pos = 0;
let mut args: Vec<String> = Vec::new();
let mut params: HashMap<String, Parameter> = HashMap::new();
let mut flags: HashMap<String, Option<String>> = HashMap::new();
@ -87,7 +85,6 @@ pub fn parse_command(prefix: String, input: String) -> CommandResult {
if let Some((param_name, param)) = arg.param.as_ref() {
params.insert(param_name.to_string(), param.clone());
}
args.push(arg.raw.to_string());
}
if let Some(next_tree) = local_tree.get_branch(&found_token) {
@ -126,7 +123,6 @@ pub fn parse_command(prefix: String, input: String) -> CommandResult {
command: ParsedCommand {
command_ref: command.cb.into(),
params,
args,
flags,
},
};