ced/lib.rs
1/// Ced, a csv editing backend
2///
3/// Refer ```Processor``` struct for library usage.
4///
5/// ### Install
6///
7/// ```bash
8/// cargo install ced --features cli --locked
9/// ```
10///
11/// ### Binary usage
12///
13/// **Ced option**
14///
15/// ```bash
16/// # Print version
17/// ced --version
18/// # Print help
19/// ced --help
20///
21/// # Start ced
22/// # Optionaly with initial import
23/// ced
24/// ced file.csv
25///
26/// # Execute script
27/// # argument with .ced extension will be interpretted as execution script
28/// # In this case, loop variants are restricted
29/// ced script.ced
30///
31/// # Import schema and import data file.
32/// # Execute a given command without opening an interactive shell
33/// ced --schema schema.csv data.csv --command 'add-row 1 100,20;write'
34/// ```
35///
36/// **Ced shell command**
37///
38/// ```bash
39/// # Type help in prompt or give --help flag for detailed usage.
40///
41/// # Get help
42/// >> help
43///
44/// # Import a file
45/// >> import file_name.csv
46///
47/// # Import a schema file. Second argument determines overriding.
48/// >> schema file_name true
49///
50/// # Print csv data optionally with a viewer command
51/// # Set CED_VIEWER to set default print viewer
52/// >> print
53/// >> print tidy-viwer
54///
55/// # Append a new row to last
56/// # Type a comma to exit loop
57/// >> add-row
58/// First Header = .. <USER_INPUT>
59/// Second Header = .. <USER_INPUT>
60///
61/// # Edit a given row
62/// >> edit-row <ROW_NUMBER>
63///
64/// # Set a limiter for a column with interactive shell
65/// >> limit
66///
67/// # Export to a file
68/// >> export file_name.csv
69///
70/// # Overwrite to a source file
71/// >> write
72///
73/// # Undo a previous operation
74/// # History capacity is 16 by default
75/// # You can override it with CED_HISTORY_CAPACITY
76/// >> undo
77///
78/// # Redo a previous undo
79/// >> redo
80/// ```
81
82#[cfg(test)]
83mod test;
84
85#[cfg(feature = "cli")]
86pub(crate) mod cli;
87
88pub(crate) mod command;
89pub(crate) mod utils;
90
91pub(crate) mod error;
92pub(crate) mod page;
93pub(crate) mod processor;
94
95// ----------
96// RE-EXPORTS
97
98#[cfg(feature = "cli")]
99pub use cli::command_loop::start_main_loop;
100pub use command::{Command, CommandType};
101pub use error::{CedError, CedResult};
102pub use processor::Processor;