From ea47b101f23d50b2d9921445d3c58c84b08644f7 Mon Sep 17 00:00:00 2001 From: Paul-Christian Volkmer Date: Wed, 8 Jan 2025 00:15:44 +0100 Subject: [PATCH] chore: remove interactive mode --- Cargo.lock | 109 ++---------------------------------------------- Cargo.toml | 3 +- src/cli.rs | 6 --- src/commands.rs | 46 +------------------- 4 files changed, 5 insertions(+), 159 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index b968ebe..43b0c01 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -40,12 +40,6 @@ version = "0.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" -[[package]] -name = "bitflags" -version = "2.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" - [[package]] name = "block-buffer" version = "0.10.4" @@ -178,7 +172,7 @@ dependencies = [ "lazy_static", "libc", "unicode-width 0.1.14", - "windows-sys 0.52.0", + "windows-sys", ] [[package]] @@ -269,19 +263,6 @@ dependencies = [ "syn", ] -[[package]] -name = "dialoguer" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "658bce805d770f407bc62102fca7c2c64ceef2fbcb2b8bd19d2765ce093980de" -dependencies = [ - "console", - "shell-words", - "tempfile", - "thiserror 1.0.69", - "zeroize", -] - [[package]] name = "digest" version = "0.10.7" @@ -316,22 +297,6 @@ version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" -[[package]] -name = "errno" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" -dependencies = [ - "libc", - "windows-sys 0.59.0", -] - -[[package]] -name = "fastrand" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" - [[package]] name = "flate2" version = "1.0.35" @@ -453,12 +418,6 @@ version = "0.2.168" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5aaeb2981e0606ca11d79718f8bb01164f1d6ed75080182d3abf017e6d244b6d" -[[package]] -name = "linux-raw-sys" -version = "0.4.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" - [[package]] name = "lockfree-object-pool" version = "0.1.6" @@ -524,7 +483,6 @@ dependencies = [ "clap_complete", "console", "deob", - "dialoguer", "indicatif", "quick-xml", "serde", @@ -628,19 +586,6 @@ dependencies = [ "getrandom", ] -[[package]] -name = "rustix" -version = "0.38.42" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93dc38ecbab2eb790ff964bb77fa94faf256fd3e73285fd7ba0903b76bedb85" -dependencies = [ - "bitflags", - "errno", - "libc", - "linux-raw-sys", - "windows-sys 0.59.0", -] - [[package]] name = "ryu" version = "1.0.18" @@ -702,12 +647,6 @@ dependencies = [ "digest", ] -[[package]] -name = "shell-words" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "24188a676b6ae68c3b2cb3a01be17fbf7240ce009799bb56d5b1409051e78fde" - [[package]] name = "shlex" version = "1.3.0" @@ -737,46 +676,13 @@ dependencies = [ "unicode-ident", ] -[[package]] -name = "tempfile" -version = "3.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" -dependencies = [ - "cfg-if", - "fastrand", - "once_cell", - "rustix", - "windows-sys 0.59.0", -] - -[[package]] -name = "thiserror" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6aaf5339b578ea85b50e080feb250a3e8ae8cfcdff9a461c9ec2904bc923f52" -dependencies = [ - "thiserror-impl 1.0.69", -] - [[package]] name = "thiserror" version = "2.0.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec2a1820ebd077e2b90c4df007bebf344cd394098a13c563957d0afc83ea47" dependencies = [ - "thiserror-impl 2.0.6", -] - -[[package]] -name = "thiserror-impl" -version = "1.0.69" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" -dependencies = [ - "proc-macro2", - "quote", - "syn", + "thiserror-impl", ] [[package]] @@ -924,15 +830,6 @@ dependencies = [ "windows-targets", ] -[[package]] -name = "windows-sys" -version = "0.59.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e38bc4d79ed67fd075bcc251a1c39b32a1776bbe92e5bef1f0bf1f8c531853b" -dependencies = [ - "windows-targets", -] - [[package]] name = "windows-targets" version = "0.52.6" @@ -1060,7 +957,7 @@ dependencies = [ "pbkdf2", "rand", "sha1", - "thiserror 2.0.6", + "thiserror", "time", "zeroize", "zopfli", diff --git a/Cargo.toml b/Cargo.toml index 7c588c1..d40ae81 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -19,7 +19,6 @@ serde = { version = "1.0", features = ["derive"] } serde_yaml = "0.9" quick-xml = { version = "0.37", features = ["escape-html", "serialize"], default-features = false } console = "0.15" -dialoguer = "0.11" indicatif = "0.17" deob = { path = "libs/deob", version = "*", optional = true } @@ -57,7 +56,7 @@ unused_must_use = "deny" # Packaging [package.metadata.deb] -copyright = "Copyright (C) 2023-2024 the original author or authors" +copyright = "Copyright (C) 2023-2025 the original author or authors" extended-description = "Anwendung zum Anpassen einer OSC-Datei an einen Standort." assets = [ ["target/release/osc-variant", "usr/bin/", "755"], diff --git a/src/cli.rs b/src/cli.rs index f19e18f..eaed0f3 100644 --- a/src/cli.rs +++ b/src/cli.rs @@ -85,12 +85,6 @@ pub enum SubCommand { help = "Entferne Einträge aus der Systembibliothek die nicht importiert werden (Optional)." )] strip: bool, - #[arg( - short = 'i', - long = "interactive", - help = "Starte interaktiven Dialog zum Modifizieren von OSC-Dateien" - )] - interactive: bool, #[arg( long = "fix", help = "Erweiterte Problembehandlung und Reparatur der OSC-Datei" diff --git a/src/commands.rs b/src/commands.rs index 835676f..8762f81 100644 --- a/src/commands.rs +++ b/src/commands.rs @@ -25,7 +25,6 @@ use crate::profile::Profile; use clap::CommandFactory; use clap_complete::{generate, Shell}; use console::style; -use dialoguer::Confirm; use quick_xml::se::Serializer; use serde::Serialize; use sha2::{Digest, Sha256}; @@ -56,18 +55,8 @@ pub fn handle(command: SubCommand) -> Result<(), Box> { compact, sorted, strip, - interactive, fix, - } => handle_modify( - inputfile, - profile, - outputfile, - compact, - sorted, - strip, - interactive, - fix, - )?, + } => handle_modify(inputfile, profile, outputfile, compact, sorted, strip, fix)?, SubCommand::Diff { inputfile_a, inputfile_b, @@ -221,7 +210,6 @@ fn handle_modify( compact: bool, sorted: bool, strip: bool, - interactive: bool, fix: bool, ) -> Result<(), Box> { let mut data: OnkostarEditor = InputFile::read(inputfile, None)?.try_into()?; @@ -236,38 +224,6 @@ fn handle_modify( data.apply_profile(&profile); } - let mut compact = compact; - let mut sorted = sorted; - let mut strip = strip; - - if interactive { - compact = matches!( - Confirm::new() - .with_prompt("Kompakte Ausgabe, ohne Einrücken?") - .default(compact) - .interact(), - Ok(true) - ); - - sorted = matches!( - Confirm::new() - .with_prompt("Sortiere Kataloge und Formulare nach Name und Abhängigkeiten?") - .default(sorted) - .interact(), - Ok(true) - ); - - strip = matches!( - Confirm::new() - .with_prompt( - "Entferne Einträge aus der Systembibliothek die nicht importiert werden?", - ) - .default(strip) - .interact(), - Ok(true) - ); - } - if fix { // No operation as of now }