1 /* PSPP - a program for statistical analysis.
2 * Copyright (C) 2023 Free Software Foundation, Inc.
4 * This program is free software: you can redistribute it and/or modify
5 * it under the terms of the GNU General Public License as published by
6 * the Free Software Foundation, either version 3 of the License, or
7 * (at your option) any later version.
9 * This program is distributed in the hope that it will be useful,
10 * but WITHOUT ANY WARRANTY; without even the implied warranty of
11 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12 * GNU General Public License for more details.
14 * You should have received a copy of the GNU General Public License
15 * along with this program. If not, see <http://www.gnu.org/licenses/>. */
19 use pspp::raw::Reader;
21 use std::io::BufReader;
22 use std::path::{Path, PathBuf};
25 /// A utility to dissect SPSS system files.
26 #[derive(Parser, Debug)]
27 #[command(author, version, about, long_about = None)]
29 /// Maximum number of cases to print.
30 #[arg(long = "data", default_value_t = 0)]
34 #[arg(required = true)]
38 fn main() -> Result<()> {
39 let Args { files, .. } = Args::parse();
47 fn dissect(file_name: &Path) -> Result<()> {
48 let reader = File::open(file_name)?;
49 let reader = BufReader::new(reader);
50 let reader = Reader::new(reader)?;
51 for record in reader {
52 println!("{record:?}");