From: Ben Pfaff Date: Wed, 16 Jul 2025 14:54:21 +0000 (-0700) Subject: system file cealnsups X-Git-Url: https://pintos-os.org/cgi-bin/gitweb.cgi?a=commitdiff_plain;h=fb816c2b23d0a2ac30cd47441dc7bf3d4bab0bc6;p=pspp system file cealnsups --- diff --git a/rust/pspp/src/main.rs b/rust/pspp/src/main.rs index d82c5d4c2b..f3f885d085 100644 --- a/rust/pspp/src/main.rs +++ b/rust/pspp/src/main.rs @@ -67,6 +67,12 @@ struct Convert { #[arg(short = 'e', long, value_parser = parse_encoding)] encoding: Option<&'static Encoding>, + /// Password for decryption, with or without what SPSS calls "password encryption". + /// + /// Specify only for an encrypted system file. + #[clap(short, long)] + password: Option, + /// Maximum number of cases to print. #[arg(short = 'c', long = "cases")] max_cases: Option, @@ -83,13 +89,15 @@ struct CsvOptions { } impl Convert { - fn warn(warning: anyhow::Error) { - eprintln!("warning: {warning}"); - } - fn run(self) -> Result<()> { + fn warn(warning: anyhow::Error) { + eprintln!("warning: {warning}"); + } + let (dictionary, _, cases) = ReaderOptions::new() - .open_file(&self.input, Self::warn)? + .with_encoding(self.encoding) + .with_password(self.password.clone()) + .open_file(&self.input, warn)? .into_parts(); let writer = match self.output { Some(path) => Box::new(File::create(path)?) as Box,