mirror of
https://github.com/PluralKit/PluralKit.git
synced 2026-02-06 05:47:53 +00:00
refactor(commands): remove args from parse command as it is no longer used anymore
This commit is contained in:
parent
58b5a26eca
commit
a21210f3ce
3 changed files with 0 additions and 7 deletions
|
|
@ -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;
|
||||
}
|
||||
|
|
|
|||
|
|
@ -18,7 +18,6 @@ interface Parameter {
|
|||
};
|
||||
dictionary ParsedCommand {
|
||||
string command_ref;
|
||||
sequence<string> args;
|
||||
record<string, Parameter> params;
|
||||
record<string, string?> flags;
|
||||
};
|
||||
|
|
|
|||
|
|
@ -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,
|
||||
},
|
||||
};
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue