Skip to content

Commit 6de789d

Browse files
authored
Merge pull request #865 from tgauth/separate-registry-lib
Separate registry_helper into lib
2 parents cd13485 + 7cc29ea commit 6de789d

File tree

11 files changed

+1312
-28
lines changed

11 files changed

+1312
-28
lines changed

build.ps1

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -256,7 +256,7 @@ if (!$SkipBuild) {
256256
}
257257

258258
# make sure dependencies are built first so clippy runs correctly
259-
$windows_projects = @("pal", "registry", "reboot_pending", "wmi-adapter", "configurations/windows", 'extensions/appx')
259+
$windows_projects = @("pal", "registry_lib", "registry", "reboot_pending", "wmi-adapter", "configurations/windows", 'extensions/appx')
260260
$macOS_projects = @("resources/brew")
261261
$linux_projects = @("resources/apt")
262262

registry/Cargo.lock

Lines changed: 34 additions & 0 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

registry/Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -21,6 +21,7 @@ strip = "symbols" # See split-debuginfo - allows us to drop the size b
2121
clap = { version = "4.5", features = ["derive"] }
2222
crossterm = "0.29"
2323
registry = "1.3"
24+
registry_lib = { path = "../registry_lib" }
2425
rust-i18n = { version = "3.1" }
2526
schemars = "0.9"
2627
serde = "1.0"

registry/locales/en-us.toml

Lines changed: 0 additions & 18 deletions
Original file line numberDiff line numberDiff line change
@@ -27,26 +27,8 @@ findArgsKeysOnlyHelp = "Only find keys."
2727
findArgsValuesOnlyHelp = "Only find values."
2828
schemaAbout = "Retrieve JSON schema."
2929

30-
[config]
31-
# No localizable strings
32-
33-
[error]
34-
invalidHive = "Invalid hive"
35-
json = "JSON"
36-
registry = "Registry"
37-
registryKey = "Registry key"
38-
registryKeyNotFound = "Registry key not found"
39-
registryValue = "Registry value"
40-
utf16Conversion = "UTF-16 conversion failed due to interior NULL values for"
41-
unsupportedValueDataType = "Unsupported registry value data type"
42-
4330
[main]
4431
tracingInitError = "Unable to set global default tracing subscriber. Tracing is disabled."
4532
debugAttach = "attach debugger to pid %{pid} and press any key to continue"
4633
debugEventReadError = "Error: Failed to read event: %{err}"
4734
debugEventUnexpectedError = "Unexpected event: %{e}"
48-
49-
[registry_helper]
50-
whatIfCreateKey = "Key '%{subkey}' not found, would create it"
51-
removeErrorKeyNotExist = "Key already does not exist"
52-
removeDeletingSubKey = "Deleting subkey '%{name}' using %{parent}"

registry/src/main.rs

Lines changed: 4 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -6,23 +6,18 @@ use crossterm::event;
66
#[cfg(debug_assertions)]
77
use std::env;
88

9-
// Init translations
10-
use rust_i18n::t;
11-
rust_i18n::i18n!("locales", fallback = "en-us");
12-
139
use args::Arguments;
1410
use clap::Parser;
15-
use registry_helper::RegistryHelper;
11+
use registry_lib::{config::Registry, RegistryHelper};
12+
use rust_i18n::t;
1613
use schemars::schema_for;
1714
use std::process::exit;
1815
use tracing::{debug, error};
1916
use tracing_subscriber::{filter::LevelFilter, prelude::__tracing_subscriber_SubscriberExt, EnvFilter, Layer};
20-
use crate::config::Registry;
2117

2218
mod args;
23-
pub mod config;
24-
mod error;
25-
mod registry_helper;
19+
20+
rust_i18n::i18n!("locales", fallback = "en-us");
2621

2722
const EXIT_SUCCESS: i32 = 0;
2823
const EXIT_INVALID_INPUT: i32 = 2;

0 commit comments

Comments
 (0)