pub mod aggregators;
pub mod completions;
pub mod date;
pub mod io;
pub mod man;
pub mod models;
pub mod output;
pub mod parsers;
pub mod search;
pub mod shell;
pub use aggregators::{
count_commands, count_commands_at_depth, filter_by_min_frequency, filter_commands,
rank_commands, rank_commands_ascending, top_n,
};
pub use completions::completions;
pub use date::{Bucket, bucket_key, civil_from_days, days_from_civil, parse_date_to_unix};
pub use io::{default_history_path, default_history_path_for, load_history_file};
pub use man::man_page;
pub use models::HistoryEntry;
pub use output::{
Stats, TableOptions, compute_stats, compute_trend, format_csv, format_json, format_stats,
format_table, format_trend,
};
pub use parsers::{
DefaultHistoryParser, FishHistoryParser, HistoryParser, ZshHistoryParser, parse_history,
};
pub use search::grep_filter;
pub use shell::{Shell, detect_shell};
pub fn analyze(input: &str) -> Vec<(String, usize)> {
let entries = parse_history(input);
let counts = count_commands(&entries);
rank_commands(counts)
}