From 8263d4e5d6d0da1f514bc176589d4fef8be4d2fc Mon Sep 17 00:00:00 2001 From: Jake Stanger Date: Sat, 20 Feb 2021 00:35:33 +0000 Subject: [PATCH] fix(cli): unable to access match struct fields in rust (#1260) The `Matches`, `SubcommandMatches` and `ArgData` struct fields were previously private and not accessible, meaning the data returned from `get_matches` was useless. This marks all the relevant fields as public. --- tauri-api/src/cli.rs | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-) diff --git a/tauri-api/src/cli.rs b/tauri-api/src/cli.rs index fb8f5ee7a..da3fae7e6 100644 --- a/tauri-api/src/cli.rs +++ b/tauri-api/src/cli.rs @@ -16,28 +16,28 @@ pub struct ArgData { /// - Value::Array if it's multiple, /// - Value::String if it has value, /// - Value::Null otherwise. - value: Value, + pub value: Value, /// The number of occurrences of the arg. /// e.g. `./app --arg 1 --arg 2 --arg 2 3 4` results in three occurrences. - occurrences: u64, + pub occurrences: u64, } /// The matched subcommand. #[derive(Default, Debug, Serialize)] pub struct SubcommandMatches { /// The subcommand name. - name: String, + pub name: String, /// The subcommand arg matches. - matches: Matches, + pub matches: Matches, } /// The arg matches of a command. #[derive(Default, Debug, Serialize)] pub struct Matches { /// Data structure mapping each found arg with its resolution. - args: HashMap, + pub args: HashMap, /// The matched subcommand if found. - subcommand: Option>, + pub subcommand: Option>, } impl Matches {