rsv_lib/
lib.rs

1use crate::{
2    args::{Count, Head, Headers, Size},
3    utils::return_result::CliResultData,
4};
5
6pub mod args;
7pub mod csv;
8pub mod csv_lib;
9pub mod excel;
10pub mod io;
11pub mod utils;
12
13pub fn csv_count(file: &str, no_header: bool) -> CliResultData {
14    let option = Count {
15        filename: Some(file.to_owned()),
16        no_header,
17        sheet: 0,
18    };
19    Count::csv_run_lib(&option)
20}
21
22pub fn csv_head(file: &str, sep: char, quote: char, no_header: bool, n: usize) -> CliResultData {
23    let option = Head {
24        filename: Some(file.to_owned()),
25        no_header,
26        n,
27        sheet: 0,
28        export: false,
29        sep,
30        quote,
31    };
32    Head::csv_run_lib(&option)
33}
34
35pub fn csv_headers(file: &str, sep: char, quote: char) -> CliResultData {
36    let option = Headers {
37        filename: Some(file.to_owned()),
38        sheet: 0,
39        sep,
40        quote,
41    };
42    Headers::csv_run_lib(&option)
43}
44
45pub fn csv_size(file: &str) -> CliResultData {
46    let option = Size {
47        filename: Some(file.to_owned()),
48    };
49    Size::csv_run_lib(&option)
50}